PDA

View Full Version : change the position of the bones ??



programmer
30-08-2009, 08:46 AM
Hi ...
Can I change the position of the bones by TrackBar ?

I mean for example :
1- by changing the value of TrackBar1 the thigh of the character will rotate from back to forward
2- by changing the value of TrackBar2 the leg of the character will rotate to back

in that way I can make new movement to the character manually

Thanks

programmer
28-11-2009, 07:26 AM
UP

User137
28-11-2009, 10:02 AM
Again, i don't know a thing about GLScene, but how it's done in other methods you need to know how math behind it works. Bone is usually a 4x4 matrix. To rotate bone you create a "rotation matrix" and multiply original bone with the rotation
(Original_bone_matrix * Rotation_matrix = bone_turned_around)

BUT after that you need to be sure that vertices assigned to bone will still follow with the bones. This is GLScene specific question and propably automatic.

If i remember right there is Geometry.pas unit in GLScene that propably contains all needed functions for you. However you need to find out yourself where the bones are in object data, or if there is functions already made to make it much easier.

http://www.cprogramming.com/tutorial/3d/rotationMatrices.html
http://en.wikipedia.org/wiki/Rotation_matrix