Local Axis Rotation Problem
Hi. I have a 3d rotation problem that really shows up my lack
of 3d knowledge lol. I'm trying to move a camera around using
the arrow keys. Left-right arrow is supposed to rotate about
local camera z axis, and up-down around local x-axis. But
this code seems to rotate around the origin. Is it something
to do with the order of operations?
Any help greatly appreciated.
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
/// Load ship Position Matrix (camera)
XForm3D_SetTranslation(&m, Pos.x, Pos.y, Pos.z);
Re: Local Axis Rotation Problem
It's difficult to say without knowing what is going on inside your XForm functions. At a guess I'd say you need to rotate the Pos.x/y/z values by the transpose(?) of the matrix you created in XFORM3D m.