simulating smoke...

hello people,
please I need to know how to simulate smoke in openGl (code or equivalent), basically there should be a cigarette rotating and the smoke should be coming out of it and I couldn’t figure out how to do that… anything you can give me would be highly appreciate it…

thanx

you can write me at
raytea@yahoo.com

Hi !

The MAM/VRS toolkit has a pretty ok smoke example (OpenGL is used for the rendering), look under examples at the smoke application, there is screenshot of it.

I have never look at the code how they do it, but all source code is available (GPL).
http://wwwmath.uni-muenster.de/informatik/u/mam/

Mikael

thanks a lot Mikeal,
but I couldn’t find the source code on the Web, II don’t know if you can help me with that…

tarek

Check out my procedural smoke demo over at
http://www.pocketmoon.com/code.htm

It’s a bit slow - it does volumetric smoke as 32 stacked 32x32 texture maps.

If you’d like a look at the code just say so and I’ll email it to you.

Rob James http://www.pocketmoon.com

that’s excellent Rob, thanks a lot,
actually I would like you to email me the code, I’d really appreciate it.
my address:

raytea@yahoo.com

Yeah, really cool … Could you send it to me too?

Paul_H_Leopard@hotmail.com

Thanks!

http://www.pocketmoon.com/smokesrc.zip

Good luck! The codes a BIG a mess

Let me know how you both get on.

Rob

I recommend using particles. They don’t look quite as cool as pocketmoon’s demo, but they’re fast, easy, effective, and looks equally good from all angles.
Just store the position, velocity and opacity of a few particles (as many as you like - more looks better, but as few as 15 can look good), and each frame randomly alter the velocity, displace the position by the velocity * the frame time, and reduce the opacity by an amount proportional to the frame time. Once the opacity is below 0 reset the particle positioned at the end of the cigarette.
Draw the particles as alpha blended billboards (use qsort() to z-sort them).

Although not OpenGL (dos and in 2d), Hugo Elias has a very nice looking smoke demo. But there is no article about how it was done. Or I didn’t find it anyway.

Maybe one could do a procedural texture map thing with this technic.

I’d like to know how it was done!

Here’s the demo: http://freespace.virgin.net/hugo.elias/updates.htm

Click the ‘New smoke demo’