Original Post
Hi firends, I was creating my 3d character animation engine recently and faced quite a few problems. In fact, I posted one in a separate thread. However there were errors in explaining. So I decided to post this new thread ( sorry for that!). Since I am not any proffessional (a bit hobbiest) and am niether very experienced (experimented 3d programming (related to games) for 6 months before becoming serious) and am young (entered my college this year), so there could be errors still. Please forgive me for that. My problem is with hierarchial systems. My engine supports both quaternion and matrix based rotation system which can be switched with a definition(#define). However following the general method of transforming a child into world using its parents world state is not helping. The problem is not with the mathematics. I even tried using the d3dx library for clarifying my math code without any reported error. Here is what I do. //for matrix Matrix childWorld = childLocal * parentWorld; //which is very general //for quat Quaternion worldRot = localRot * parentRot; //This one I derived Vector WorldOffset = parentrot.rotateVector(offset) + parentOffset //from the above The result isn't happy in either case. My test program had a chain of cubes linked to each other with parent child relationship. I used a function to give each of these cube's coordinate frame some local rotation and offset so that the chain may look like a parabola. Now I expected that when I move/roatate the cube representing the head of the chain, the parabolic shape of the chain would remain intact, while the whole structure will show the translation/rotation as child nodes would do when its parent is transformed. Instead the chain is showing strange movements, like a t-rex's tail. What's more surprising is that intially the transformation sits in very well i.e., with the intial local transformation the child transforms well with respect to its parent, however things become strange when I do that at run time. Even my hierarchy traversal has no problem, a link list handles that. One thing more, my immediate representation of rotations is euler. To that someone suggested me to negate this euler rotations before calculating the quaternion. But I figured out that wasn't the problem. I am ready to provide my test application and libraries and source code if the need be so. Anybody ready to pay me some attention and time will be much appreciated, I am starving and my hair's turning gray, somebody save me!!! -Obi