Project Page

 

Project Description

Code and Program User Guide

 

Example Ray Marched Image of a (Dense) Smoke Bunny

 

An Example Smoke Simulation

Click on the above image to view the smoke simulation. It is provided as a test-benchmark for your own solver to locate bugs.

A bunny with NumVoxelsAlongLongestDimension=64 and widthOfSDFBand=6 was converted to a density field, and the simulation took place inside this density field of dimensions 64x63x49. The initial velocity field was identically zero. No diffusion or dissipation is applied to the density or the velocities. I used a maximum of 100 iterations in the conjugate gradient solver. This results in a tolerance of approx 1e-3. The simulation domain was open in the top (y) to make the Poisson matrix numerically non-singular. The above animation is 400 frames, and I used a timestep of 0.1. The only force acting is a gravity force which is -9.8*density in the y direction.

For rendering I used a single light source with an intensity of (1.0, 1.0, 1.0) (notice that the smoke is lighter than the bunny above which had a light source intensity of (0.5, 0.5, 0.5)).

 

How to Assemble a Movie from a Number of PNG Images

In order to make a movie from a number of PNG images you can use the mencoder program. Here I describe how you can get this program and describe a simple example of its use.

On Linux on a machine here at Daimi, you can simply include /users/bang/tmp/bin in your PATH environment variable. The mencoder program resides in this directory. Alternatively you can copy it to your own directory. If you wish to download and install mencoder yourself, the thing that worked for me was to download the full source-code from here: http://www.mplayerhq.hu/design7/dload.html (Look for MPlayer v1.0pre7try2 source). Then unpack it in a directory (use the 'bzip2 -d' and the 'tar xvf' commands with the appropriate files as argument). Then type ./configure --prefix=XX  in the MPlayer-1.0pre7try2 directory, where XX is the directory where you wish to install mplayer and mencoder (note that you must have write access to this directory). Next type gmake and when compilation is finished type gmake install. Then you should be ready to start. If any problems occur, consult the README files or the full documentation here: http://www.mplayerhq.hu/DOCS/HTML-single/en/MPlayer.html.

On Windows you will have to download and install mplayer and mencoder yourself. You can download it from here: http://www.mplayerhq.hu/design7/dload.html. You will have to download both the Windows releases zip file (which includes the binaries), and the essential codecs package. Just extract the files. The essential codecs must be placed in the directory mplayer/codecs. And then you should be ready to start. If any problems occur, consult the README files or the full documentation here: http://www.mplayerhq.hu/DOCS/HTML-single/en/MPlayer.html.

When you have installed your program you are ready to encode your produced PNG image files into a movie. A codec that worked for me on both Linux and Windows is the following. Just place yourself in the directory where your PNG files are located. Then type

mencoder mf://*.png -mf w=500:h=500:fps=25:type=png -ovc lavc -lavcopts vcodec=wmv2 -oac copy -o output.avi

Note that you must supply the width and height of your images (in this case width is 500 and height is 500), and that the resulting avi file is placed in the file output.avi.

The mencoder program supports a lot of different codecs, and feel free to experiment with others. You can consult the full documentation of mencoder, including examples of encoding parameters, here: http://www.mplayerhq.hu/DOCS/HTML-single/en/MPlayer.html.

 

Links

Glut installation on Windows

Glut Manual

OpenGL homepage

The OpenGL Redbook

The not so short introduction to Tex

CVS Documentation

SparseLib++

IML++

MV++

Corona Image Library