Object orientation in 3d

Anonymous

Veteran
Hi,

I'm working on a visualization program using Visual Basic + openGL. Now I'm having some difficulties getting the right scene rotations when using a mouse. I have tried to map the 2d form coordinate system on a 3d sphere (in an attempt to get the right vector for the glrotate command), but that gives me some freaky results :)
My question is, is there a standard method for doing rotations/object orientation in 3d?

Thanks
 
Someone will no doubt be able to give a much better response than this but I think what you need to do is to map Mouse X axis movement onto a rotation about the Y axis, and map Mouse Y axis movement onto rotation about the X axis.
If you are rotating an object rather than the whole scene you will need to translate it's origin to the world origin before performing the rotation, and then translate it back. This can be concatenated into one operation using matrices (I think!).

Someone who knows these things will be along shortly to correct my ineptitude. :)
 
Back
Top