Final Project Report:
Project
Description:
Visualization of grass on the floor, and the reaction of the grass applying
wind on it.
I am creating grasses that will be generated in group. A group of
grasses general have an average of
5-6 pieces of grass. and grass within a group will be generated around
the center grass of the grass group.
Grasses are possible to have the same x,y values (I used XY plane as my
plane and grass grow on Z axis.
Wind is implemented with directional vectors and moving particles.
The directional vector will cause the
moves of particles. When particle "hit" the grass, the grass will
bend according to the force given by the
wind particles.
Detail:
Map:
Map is a flat ground if there is no modifications made by the user.
There is nine control points on the
ground no matter how large it is. (It is too slow to find the normals
of polygons and vertex when the
map is larger) Normals of the control vertex, and normal of its corresponding
polygons are calculated
for a more smooth surface.
Ground is make of 8 triangles.
Grass:
Each grass consists of 14 cylinders with a cone at the tip of it.
Each joint of a grass have different angle,
and they change differently according to how much force is apply
to it. When the angle (angle with normal)
is larger, the wind will have lesser effect to the grass. I implemented
the grass this way because I don't
want the grass to bend like a straight line.
Wind:
Wind particles are data that contain it v vector, the vector changes depends
on where it locate, RK4
Interpolation is used to update the wind particles.
Vectors that updates the wind particles are three dimentional vectors.
Tornado like wind could be
implemented. I have a tornado data set, but It didn't come out as
I thought.
Progress:
I visualized grass and its animation and I thought. (I don't know
if it is truely natural movement, but I think
It is real enough)
I begin this project with only one piece of grass with only one strip,
after that, I give more strip to it.
When the piece of grass is ready to be blow by wind, I used the two dimension
wind as the one in program 3.
It didn't work as I thought It would at first, and all grasses disappear
somehow due to the wrong calculation
of the grass angles. The next steps I did was to make everything
3D.
I modified all the 2D wind in to 3D wind, in this process, I used
Trilinear Interpolation to calculation the affects
to the wind particle from the vectors surrounds it. Since Z vector
is in the wind vector now, I added the z affects
to the grass. Z vector won't change the Z angle of the grass (I didn't
change it at all, but it is there though), instead
it changes both X and Y angles of the grass.
After all these ideas are done, I started working on the height of the
ground, I used 9 control points and join
them together with 8 triangles, and normals for each vertices and polygons
are calculated to make the surface
smoother. Since I grow my grasses on a flat land at first, I have
to use Bilinear Interpolation to find the translate in
Z of the each grass.
Fog:
The last steps that I do for this project is Fog, which is my original
project proposal. I didn't use particles
to make though it was my original idea. It is pretty impossible to
have particles cove the whole ground and
use GLBlend to make it transparent. (It will be too slow) As
a result, I used GLFog.
There are some unexpected effect after implementing the fog, so I add some
extra features, like changing
color of the fog. It looks like we are under the sea....
Future:
I would really like to do the grey scale terrain mapping technique.
This technique create terrain with a
grey-scale bit map. The whiter the bit map is, the higher the terrain.
I didn't allow the user to design their
own wind, and it will probably be implemented in the future when I have
more time working on this project.