Ice Drawing Program
CSC 471 WINTER 2004
Dat Phan
Download: Ice4.zip
User Interface:
I had to do a bunch of math to get the user mouse inputs from 2d pixel coordinates
to map to the 3d world coordinates with perspective. The formula I came up with works
well even though it is just an approximation.
Growth:
To mimic growth I put 2 floats in each ice node object, one for max scale and one
current scale. For each redraw I increment the current scale a fraction of the
difference between the max scale and the current scale. This gives the objects a nice
natural growth animation.
Crystals:
To make the crystals seem like they are sprouting new branches I had to give each set
of branches their own scale factor.
Because they must be recalculated each time they are drawn, the crystals hurt performance
drastically. I tried using OpenGL display lists for each crystal, but that did not improve
performance.
- Left click with the mouse to draw single objects. The longer the mouse button is held down the larger objects get.
- Click and drag to draw lines of objects.
- Right click to access the menu
Here is a scene I whipped up in a few seconds. To add variety to the ice chunks I used a random number generator to give each chunk a tilt factor. I tweaked the cloud texture given in class to make the ice textures.
Here's a shot showing off the transparency. Too bad the program runs slow with transparency enabled.
The crystals took a lot of tweaking after I got the basic code down.
These are the different complexities of the crystals.
These shots show a crystal with different fractal depths.