# tree physics and more

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

## Recommended Posts

hi there. please answer me a question: how would you represent a real tree(a plant, not a data structure) in a computer simulation. i'm interested especially physicaly speaking, because i don't know how can i represented it's internal "resistance structure". the tree should act realistic in different atmospheric conditions and should act realistic when it's choped down. but ofcourse, there should be a very strong relation between it's physical representation and it's graphic representation (it have to look good). i have some ideas, but they are not working very well on paper. please say everything that comes into your mind. thanks

##### Share on other sites
segment branches as rigid bodies, link them by loose constraints? Bit like a ragdoll, with stiff joints.

Or some 'bendy material technology' that I'm not aware of. Must tricks very specific to that problem that you can use.

Use a box to model the branch collision, or a convex hull, like a chopped pyramid or a chopped cone. Use a small sphere to model the 'bushes' (the groups of twigs and leaves at the end of a branch), add a sort of force field generator that outputs a force back to the bush when objects and environment gets closer to the centre of the sphere, to model some sort of soft collision with the leaves. When applying wind, apply a force on each of the bushes, with some small random perturbation. Could be dependent on a time-dependent noise function, like a perlin noise, with inputs like spacial coordinates, and the time, like when modeling clouds and sea waves.

ect...

##### Share on other sites
thanks, your idea is pretty good. so i can use some cylinders or cones to represent the branches, and some simple cylinder collision with them. i can use a rag doll like model, with angle constraints, that should be stiff or soft,depending of the mass of the segment and it's position relative to that branch'es "root"(origin). also the idea of some noise for the leaves is very very good. but there is a small problem. if i have to chop that tree down, there should be some real time deforming(i can do that, no big deal), but the main problem is how the tree will react to cuts in it's trunk or it's branches.
let's say we split the hited segment into 2 segments, making a new joint. so how can i calculate how the tree is declining and falls down eventually. how can i calculate the forces and the material's resistance. because if the rigid body is a single line segment, there is no volume, so there cannot be forces pushing down the tree to a side?

i think that one answer could be that i should make the angle constraint weaker in some direction. what do you say?

##### Share on other sites
There is an excellent chapter on tree physics in Graphics Programming Methods...

http://www.amazon.com/exec/obidos/tg/detail/-/1584502991/104-4589823-5400761?v=glance

I don't have my copy with me right now so I can't go over the exact contents, but if I remember it goes over animating the tress both procedurally and by simulating them with physics.

##### Share on other sites
well, that's ok, but the problem is that i cannot buy the book.i'm from romania and they don't send books here because a lot of my compatriots give them false credit card numbers. so even i am not one of them, i cannot have it. but thanks anyway

##### Share on other sites
Quote:
 Original post by meeshoolet's say we split the hited segment into 2 segments, making a new joint. so how can i calculate how the tree is declining and falls down eventually. how can i calculate the forces and the material's resistance. because if the rigid body is a single line segment, there is no volume, so there cannot be forces pushing down the tree to a side?i think that one answer could be that i should make the angle constraint weaker in some direction. what do you say?

"I'm a lumberjack and I'm ok, I sleep all night and I work all day....!" (Famous Monty Python song).

It's a very difficult problem though. I mean, this is touching mechanics for materials, stuff *real* engineers use to design buildings and bridges. Material resistance, and all kinds of sheer, compression, twist, ect...

ok, keeping with the idea of joints. As you cut down the tree, you can displace the actuall point of application of the joint. So, it starts off in the centre of the trunc, and as you cut though, shift it to say, the centre of what hasn't been cut yet, the gravity will do the rest and the unbalance should make te tree bend, until it can bend no more, then delete the joint.

Obviously, you'd have to do the lumberjack things, and cut the tree at the right point, in the right direction (or else, the saw will be stuck under the tree, as it will start falling in the wrong direction).

I'm just guessing though, since I've never done such a complicated thing myself. THere must be some cool tricks though. Must be...

http://edgarapoe.home.mindspring.com/quixotic/blustery_trees.htm

##### Share on other sites
thanks for the explanation and the link. well, i lived at the countryside when i was younger, i helped people cutting down trees, so i know how to do it. although i think i will stay with this approach, because it's more simpler than others, i've read some articles here on gamedev about "real deformation of solids" using a method called FEM(finite element method). this method is used by engineers and it's about supposing that the tree is a continous matter form made from a finite number of elements, each linked together by nodes(joints). but this approach looks to be computationaly expensive and very hard to implement.

finaly, the game should be realistic, not real :)

##### Share on other sites
How do you want to chop it down? A player can use an axe and do it? If so then you can just make the player show the chopping animation and when it's done, find the part of the tree that was hit (the cylinder or enclosing surface) and split the triangles in it with the plane that it was hit on. Then add some velocity to the upper part (the one that is above the splitting plane - orient this to point up) and gravity will kick in and topple it.

It's not realistic, but will look pretty good.

##### Share on other sites
well, it's quite ok what you said. i'm thinking of making so(the player hits the tree and there is a mesh deforming algorithm), but this is not the problem. the problem is how do i know when the tree will fall? or, if i want to chop a branch first, when the branch will fall, how much it will bend? but i think i will solve it using some kind of bones and angle constraints. thanks to all of you and keep posting

• 21
• 13
• 9
• 17
• 13