Page 1 of 1

How to create imitation of the flexible stick.

Posted: Mon Oct 30, 2006 7:23 pm
by Magnet
How to create imitation of the flexible stick.
I must influence upon one edge and stick must be bent..
Image

Posted: Mon Oct 30, 2006 9:36 pm
by sgt_pinky
Well, bending equation for a beam is:

d=PL^3/(3EI)

Where d is the displacement (in millimeters), P is the force (in Newtons), L is the length to the point of bending (ie, in your image, you would calculate this at four points), E is the modulus of elasticity of the material (steel = 210,000 MPa), and I is the moment of inertia.

To calculate the moment of inertia, you need the cross-section of the stick. Lets say it's round, then we use:

I=pi*r^4/4

Where r is the radius of the cross-section.

Cheers,

Pinky

Posted: Mon Oct 30, 2006 11:59 pm
by CodeDog
That is assuming that the force applied is always perpendicular to the tip of the stick. If the vector of the force is constant ( like for example gravity on a stick hanging out sideways) then as the stick deforms, the angle of the force applied to the tip of the stick will change. You may or may not want to correct for this depending on how accurate you want your simulation to be.
With a force that is aways perpendicular to the tip and given enough force applied, the stick will form a spiral. This is not the case if the vector of the force remains constant.

Posted: Tue Oct 31, 2006 12:10 am
by sgt_pinky
My method is only valid for small displacements anyway. It is just a suggestion of a method - you need to try it, and see if it is good enough for what you need.

Posted: Tue Oct 31, 2006 8:01 am
by Magnet
I do not know how to begin.
That it is necessary to use?
I must use the bones to bend my model?
I never with this did not face.
Please help me.

Posted: Tue Oct 31, 2006 8:28 am
by CodeDog
Start with:
http://irrlicht.sourceforge.net/tut004.html
This will show you how to move nodes.

sgt_pinky gave you the math you need.
It's up to you to write the C++ that uses the math.

Posted: Tue Oct 31, 2006 10:43 am
by Magnet
You not understood me.
I do not know how to start realisation this problem.
I have a model of the fishing rod. How to bend it?

Posted: Tue Oct 31, 2006 11:46 am
by bitplane
if you want to use bones, you can set bone positions using acki's x custom bones patch.
but for such a simple mesh as a stick it would be just as easy to move the vertices of your mesh manually.
use smgr->getMeshManipulator()->createMeshCopy(IAnimatedMesh->getMesh(0)) to get an SMesh from your model file, then you can access the SMeshBuffer and deform it by setting the positions of the vertices.
start your journey into the docs at the mesh manipulator and finish somewhere around SMeshBuffer. (you'll need to cast SMesh->getMeshBuffer to an SMeshBuffer)

Posted: Tue Oct 31, 2006 9:13 pm
by Magnet
Thnx.
As I afterwards can force to move the bones on curve?