How do I create a fire sphere (fireball) in opengl? (opengl Visual C++)
- by gn66
I'm making an evil Pacman in OpenGL and I need to make my spheres look like a fireballs, does anyone know how I do that?
And what material colour should I use?
Also, is there a colour palette to change the colour of my materials?
This is how I create a sphere:
GLfloat mat_ambient[] = { 0.25, 0.25, 0.25, 1.0 };
GLfloat mat_diffuse[] = { 0.4, 0.4, 0.4, 1.0 };
GLfloat mat_specular[] = { 0.774597, 0.774597, 0.774597, 1.0 };
GLfloat mat_shine = 0.6;
glMaterialfv (GL_FRONT, GL_AMBIENT, mat_ambient);
glMaterialfv (GL_FRONT, GL_DIFFUSE, mat_diffuse);
glMaterialfv (GL_FRONT, GL_SPECULAR, mat_specular);
glMaterialf (GL_FRONT, GL_SHININESS, mat_shine * 128);
glPushMatrix();
glTranslatef(x,y,0);
glutSolidSphere(size, 20, 10);
glFlush();
glPopMatrix();