Physics Demo: Grass Simulation

Physics Demo: Grass Simulation




Description:

This project demonstrate the using of NFGE:Verlet Physics.

Each grass has a simple bone structure: from its root to its top. More bone it has more organic look it will has.

I'm binding each bone a verlet particle and connecting themselves to the particle in the parent's bone with spring constrain. For making particles in the bone structure more stable, I also create four fixed particles on the ground that connect each bone particles with spring constrains.

The force applying or collision resolving on any bone particles will also influence all the other bone particles since they are connecting with spring constrains. And the four ground fixed particles will bring each bone particle back to its original position with the spring constrain force.

The render of the grass is using the BoneMesh in NFGE, which means each vertex in the mesh stores boneIndices and bone weight up to four. It allows GPU to calculates each vertex position bases on the blend result of multiple bone transform matrices. In NFGE, each bone vertex can blend maxima four bones. Doing all this can create smooth curve when bone is bending.

The vertices in the grass mesh is only blending with two bone (current bone and adjacent bone)

The demo is made in NFGE, which is my own game engine written in C++.

The UI of the Demo is using Dear Imgui(https://github.com/ocornut/imgui)

Demo Video:




Technical Support:

My Instructor: Peter Chan 

Comments

Popular posts from this blog

NFGE

3D Graphic Demo: YBot-Simulation(In Progress)