May Ang
mang@ucsc.edu
This program was to be a rain/hail/snow animation using a simple particle system. The particles would react to the ground depending on what they were. And there would be some parameters that the user could adjust.
I have a particle system that falls under gravity. Particles change depending on what setting(rain/hail/snow). Hail and snow interact with the ground. Hail bounces(sort of, they kinda disappear after bouncing) and snow accumulates. The size of hail can be adjusted. There's supposedly controls to adjust how fast the particles are moving but they both look the same to me. I added some camera controls too. This isn't as smooth as I'd like but I've sent a quite a bit of time messing with values and they're mostly not that much different.
I did this in Linux using OpenGL and was planning to use GLUI to create a GUI to adjust parameters. I ran into an issue with the connection between the redrawing and the controls. For choosing whether rain/hail/snow it would only animate/redraw if I drag the GUI window around the display window. I don't like or understand FLTK very well so I decided to use keyboard commands.
CompilationRun the makefile in the terminal. Then ./particles
ControlsKey | Action |
---|---|
r | Rain |
h | Hail |
s | Snow |
= | Increase Hail Size |
- | Decrease Hail Size |
, | Decrese Speed? |
. | Increase Speed? |
UP | Camera Move Forward | DOWN | Camera Move Back |
RIGHT | Camera Pan Right |
LEFT | Camera Pan Left |
Page Up | Camera Tilt Up |
Page Down | Camera Tilt Down |
q | Quit |
Rain | Hail | Snow |
---|---|---|
I have not been able to find a good screencast software for Linux. RecordMyDesktop apparently does not work with my graphics card. And the other one I found, there are posts on forums about it messing up their computer and I'd rather not risk that
Tutorial & base code
http://freespace.virgin.net/hugo.elias/models/m_main.htmFalling under gravity & bouncing