Final Project - Math 155B - Student: David Chhat

Description:

This is my final project, a teapot. Well not just a teapot, but a teapot 
with some functionality, it pours water into a water surface, creating 
a series of nice water ripples and waves.

Teapot movement was created using basis quaternions that we learned in 
the previous project and the water that comes out of it are cheap 
spheres that work using a basic particle system.

The heights of the water ripples are calculated using a positional 
water surface formula:

h(u,v) = A*sin(f*|p-r|)*exp(-|p-r|*a)

where A is the amplitude, f is the frequency, a is the attenuation, p is 
the center pt of the ripple and r is the u,v position. Multiple ripples 
are calculated simply by adding their heights together.

Because my water wave grid is 110x80, it becomes very expensive to 
calculate multiple ripple (up to 30), and become very slow very quick. I 
originally wanted the water wave to be created using bezier patches, but 
realized that using just polygons was efficient enough, plus it took so 
long getting the normals to look just right and figuring out how to 
optimize the code to make it run quicker.

Also I added some controls to adjust the wave properties, such as those
constants in the above formula, as well as timing.

So enjoy the program!

Download

==========================================================
KEY CONTROLS
==========================================================
DRAWING METHODS
w - wireframe on/off
m - lighting on/off
b - flat/smooth shading
n - water on/off

WAVE ADJUSTMENTS
a - attenuation increase (shorten lifetime of wave)
A - attenuation decrease (lengthen lifetime of wave)
d - amplitude increase (increase height)
D - amplitude decrease (decrease height)
f - frequency increase (shorten wavelength)
F - frequency decrease (lengthen wavelength)
t - deltat increase
T - deltat decrease

TEAPOT MOVEMENT
mouse - hold left button and move (quaternion movement)
i - move teapot away from viewer
k - move teapot toward viewer
j - move teapot left
l - move teapot right

r - reset to default properties
Normal Mode:


Single Ripple:


Multiple Ripple, Single Spot:


Multiple Ripple, Multiple Spot: