-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mark Ivey wrote: > I know that skeletons are used to deform meshes, like a tree blowing in > the wind or (from my original email) rag-doll physics. These links > suggest that Unreal also uses bones for vehicles: > http://udn.epicgames.com/Two/SVehicleCreation > http://www.psyonix.com/NewVehiclesTutorial/
Rag doll physics deals with characters - you are moving bones according to some physical model and the engine deforms the mesh accordingly (i.e. if the leg bone moves also the skin mesh and texture are deformed with it). Tree blowing in the wind by skeletons - well, you can certainly do it, but it is an overkill, IMHO. And certainly you do not want to do it with Cal3D, because that is intended for characters explicitly and there would be LOT of overhead with that. Not to mention how complex such skeleton would be. For animating a tree it is completely sufficient to precalculate the animation, e.g. in Blender or Max and just use pre-deformed meshes. Of course, if you want to animate a tree procedurally then a skeleton is better approach, but Cal3D will not work well for that. Unreal has a specialized engine for that, they do not use the same code as for characters. Again Cal3D will not be good for this. I also suspect that they are using bones in Maya and Max with cars only as a way how to connect the pieces of the car together and not really for animation/rendering purposes - did you notice the star-like hierachy of the bones in the car? That is nonsense from the animation point of view (unless you are modelling an octopus) and it is obviosly only used by the exporter to parent the pieces together. The proper animation is normally achieved by joints in the physics engine (e.g. the physics in Soya is done using ODE and ODE joints). The joints in ODE form also a kind of skeleton, however one very different from the simple bones which Cal3D has. E.g. if you want to do rag doll physics on a Cal3D character, you will need two skeletons - one for animation in Cal3D and another made out of ODE joints (assuming that you are using ODE) and ODE bodies to describe the masses of the character. Then you would drive the Cal3D bones from the ODE hierarchy during each frame - you need to hierarchically update the position and orientation of each bone from ODE data. Definitely a non-trivial job to implement - lots of matrix/quaternion algebra there - for example a human body has over 70 joints, many with multiple degrees of freedom and some are even mutually dependent. It is possible to do it, but I would say that this is outside of the capabilities of most hobbyist coders unless you have the required knowledge already. You could simplify the skeleton at the expense of realism (that's what games do - you will rarely find more than 20-30 joints there), but still the math is the same :) > Your quote about a hammer suggests you know a better way. I'm asking > what that is. As I said - use normal transforms, unless you want to do physics (why e.g. a clock would need physics is beyond me). These are called "volumes" in Soya, AFAIK. If you want to spin a wheel just apply some constant rotation each frame. Even better, make the amount of the rotation proportional to the elapsed time between two frames and the velocity of the vehicle and you are set. Ideally, the spinning of the wheel will be driven by the physics engine itself and you do not have to care about it - you just apply force to "push" the car forward or use the motors in ODE to apply torque to the joint where the wheel is attached. However, this is all documented in the ODE documentation. Jan - -- Jan Ciger GPG public key: http://www.keyserver.net/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org iD8DBQFDWYh7n11XseNj94gRApCTAJ9BkqJFWGFZ+PEoqX4sdUHFInRSgwCfSa2k hw9jqWhFf9hSLYxis8x9sbo= =VFiJ -----END PGP SIGNATURE-----
