04-08-2002, 12:29 PM
Let's say I have an orientation Quaternion and a positon Vector, that presents the real camera position in the world.
How do I apply these things correctly to the glMatrix before drawing the scene?
So that it moves real inverse. Like I would sit in that camera and fly around. And the thing is I don't want a fixed world coordinate, which I transform and move with the quaternion, I just want real camera position and orientation, just in the scene drawing it should get inverted to make the right thing for moving the world.
I tryed all different things without success.
I have maths for inverting a quaternion and for transforming vectors with quaternions, multibly quats, etc.
and a QuaternionToMatrix function, that should do the rest.
But how to do things before drawing the scene?
How can I apply this?
glLoadIdendity
glMultMatrix QuatToMatrix(cam.orientation.inverse)
/Draw sky box
gltranslate ??
/DrawScene
the above seems correct to me. But what about the translation? Thanks for help! I would be really glad, I am searching around since weeks already, tried 100 different combinations and so on. All without success!
Hope you can help!
greetings,
Baboon (Silk)
How do I apply these things correctly to the glMatrix before drawing the scene?
So that it moves real inverse. Like I would sit in that camera and fly around. And the thing is I don't want a fixed world coordinate, which I transform and move with the quaternion, I just want real camera position and orientation, just in the scene drawing it should get inverted to make the right thing for moving the world.
I tryed all different things without success.
I have maths for inverting a quaternion and for transforming vectors with quaternions, multibly quats, etc.
and a QuaternionToMatrix function, that should do the rest.
But how to do things before drawing the scene?
How can I apply this?
glLoadIdendity
glMultMatrix QuatToMatrix(cam.orientation.inverse)
/Draw sky box
gltranslate ??
/DrawScene
the above seems correct to me. But what about the translation? Thanks for help! I would be really glad, I am searching around since weeks already, tried 100 different combinations and so on. All without success!
Hope you can help!
greetings,
Baboon (Silk)