How do I create a fire sphere (fireball) in opengl? (opengl Visual C++)
Posted
by
gn66
on Game Development
See other posts from Game Development
or by gn66
Published on 2012-04-23T15:24:50Z
Indexed on
2012/09/21
21:57 UTC
Read the original article
Hit count: 207
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();
© Game Development or respective owner