Jump to content
  • Advertisement
Sign in to follow this  
Richard3d

Fast Simulation of Realistic Trees

This topic is 2542 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello Everyone,

I am currently trying to implement a realistic dynamic vegetation system. I came across this awesome white paper found here http://freeelectron.org/xTree/ 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
Advertisement
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
when you figure out how to bond branches you just apply to second model the difference between branches positions and you have force

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!