View Full Version : Rotations not correct

06-28-2004, 08:36 AM
I've exported an amination from 3DSMAX to VRML and tried to recreate the movement with OpenGL. Nothing was the same. When I rotated a part of the model around more than one axis, the movement became weird. It rotated my mesh in a bad direction. I saw, that in the WRL file - though I only rotated the element around one axis - the rotation was done around all three.
As I have almost completed my first big OpenGL app, I'm very angry about this... Can anyone tell my what can I do?

...I know #1: "use the 3ds or whatever file format..." - well, I passed some days understanding VRML and found it good. I don't want to learn 3ds, or any other format now
...I know #2: "there are good converters on the net, blahblahblah..." - if someone could tell me where I can find a free app that is able to export animation too, it would solve my problem (I think:))

pls hellllp

06-28-2004, 12:41 PM
3dsmax uses another coordinate system than opengl. i dont know exactly which one, but you could either google for it or have a look the this funny colored arrows in the modeling window of max to get the uses system. i think x points away, y points left and z upwards. build a conversion matrix from the max system to the one you use in your code and transform each read vertex by it.

example matrix:
0 1 0 0
1 0 0 0
0 0 -1 0
0 0 0 1

this matrix would swap the x and y axis and invert the z axis.

if it does not help, describe a little more detailed, what you are trying to achieve and how you did it. dont offend people before they answered...

06-28-2004, 01:58 PM
I've read many topics about this sort of problem, but there were only these two kind of answers...

Ok, the problem is the following:
- I rotated the arm of my human model towards me (facing the viewer), call it X axis in the 10th frame
- in the 20th frame I rotated the arm along the Y axis
- the result in 3DSMAX was a model rotating his arm upwards, then sidewards

What I got was an animation, where my model rotated his arm till the 10th frame upwards, then, from 10 to 20th frame along X, Y and Z axis. I looked at the source of the WRL file and saw, that what I did was correct, only the values were incorrect. When I exported the same anim to ASE, I got different values. As I haven't written my ASE loader yet, I don't know, which values are correct.
I suppose, ASE should be, as WRL looks like having bad values...

If you want, I can write here some of the values that I got, but I didn't want to eat up too much space.