Sign in to follow this  
Richard3d

Fast Simulation of Realistic Trees

Recommended Posts

Hello Everyone,

I am currently trying to implement a realistic dynamic vegetation system. I came across this awesome white paper found here [url="http://freeelectron.org/xTree/"]http://freeelectron.org/xTree/[/url] in pdf form. The paper is somewhat lengthy so I wont go into the details but the issue I am having problems with is calculating a node's final world position from it's relative angles in the respective XY and YZ planes. The article explains the process in depth and I am fluent with matrix and quaternion mathematics however their mapping from the separate 1D (angle wise) spaces to a single rotation (quaternion) is not working for me. I understand the axis-angle idea and the continuity behind but here is where I am seeing issues as well. Consider any node that resides in the XZ plane with a parent node fixed at the origin. If I project the vector (childPos-parentPos) onto the respective XY and YZ planes I would get an angle of 90 degrees (remember we are measuring from the Y axis as stated in the paper). There are many points in the plane that would have projections of 90 degrees in both planes unfortunately that always maps to a single rotation, where the angle = sqrt(90 *90 + 90 *90) and the axis = Norm(90, 0, -90). So where am I going wrong? I appreciate anyone taking the time to help with this! Thanks - Richard

Share this post


Link to post
Share on other sites
You can use position based midpoint simulation with fixed timestep and apply the positions directly in a geometry shader.
Position based physics can be done on the GPU using pixel shaders and dynamic textures.
By having an invisible edge for each connected pair of visible edges, you will get stiffness from the triangle.
Every edge will try to enforce a constant distance between it's nodes by measuring the real distance, comparing it to the wanted distance and applying forces.

Share this post


Link to post
Share on other sites
Thanks for the responses everyone though they were not quite what I was looking for. It turns out the mathematics were correct but I was getting some numeric imprecision. The key is the dampening and stiffness factors. The simulation becomes unstable when dampening is uniform across a branch. Decreasing the dampening a tiny amount over each successive node fixed the problems I was having. The idea of moving the simulation to the gpu is an interesting idea but the proposed method was not ideal for this type of simulation, rotational based springs are still much faster and model the physical characteristics of branches/trees much better than any position based method

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this