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);

glutSolidSphere(size, 20, 10);
  • 8
    \$\begingroup\$ Hmm, before Byte56 will downvote your post, you might want too google for ways of simulating fire. \$\endgroup\$
    – teodron
    Commented Apr 23, 2012 at 15:43
  • \$\begingroup\$ @teodron 5 votes for that comment... I guess I have a reputation around here :) I also have a reputation for grammar, so you may want to Google the correct usage of 'too'. ;) \$\endgroup\$
    – House
    Commented Apr 25, 2012 at 20:43
  • \$\begingroup\$ @gn66 The color you use is entirely up to you. Fireballs in games come in a range of colors. The only questions you ask in the body of your post is about color. You never said if you wanted realistic fireballs, animated fireballs, etc. Not everyone has the same idea of what a fireball is. Try adding an image. So, -1 for lack of research and an unclear question. \$\endgroup\$
    – House
    Commented Apr 25, 2012 at 20:50
  • \$\begingroup\$ @Byte56 I swear, I must have been set up by the grammar nazis or the evil alphabet gremlins on that one. Sorry.. :-s \$\endgroup\$
    – teodron
    Commented Apr 26, 2012 at 6:42
  • 1
    \$\begingroup\$ There's never an easy way with OpenGL \$\endgroup\$
    – Luke B.
    Commented Sep 21, 2012 at 19:53

2 Answers 2


Unless you have a reason for your fireball to be actual geometry, I'd opt for a simple 2d impostor instead.

There's a simple photoshop tutorial for making fireballs here: http://sol.gfxile.net/firey/index.html

The resulting image looks like this:


To animate the fire, just overlay a few textures like that with additive blending and rotated around the z axis. Maybe add a particle system for flair.


Search for "Realistic and Controllable Fire Simulation" on Google.

http://www.cs.sunysb.edu/vislab/wordpress//papers/VoxelsOnFire.pdf is one example

For starters, you should set a simpler object, that you create from triangles (not the GLUT ones) and think of ways of animating fire. There are way too many possibilities: particle effects, voxels, shaders. Google for any of these ways of simulating fire.. your question is more about explaining/doing a tutorial on how to implement such an effect, so it can't be answered here. Good luck in selecting your tools ;)


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .