I'm writing my own mesh viewer and try to rotate my model with a mouse. The problem is that the setRotation function is RELATIVE to the MODEL. If I move my mouse up, I want to rotate the model around the WORLD X-axis (so the part of the model that is at the top of the screen will move away from me) and if I move the mouse to the left, the part of the model that is currently left will move away from me, and the part on the right will rotate towards to me (so around the WORLD y-axis.
There is nice code available on the net (trackball.cpp) to do this with quaternions, but in Irrlicht I can't find a function to rotate my model in WORLD space ???? The closest functions I can find is getAbsoluteTransformation and getHorizontalAngle(), but they just get the info and I want to do the opposite: 'setAbsoluteTransformation'.
Most engines I used thus far, have absolute rotation functions (for instance Quest3D and Truevsion3d). Have I finally found something Irrlicht can't do??? I hope not, as this is really of vital importance for my project... Or is there a clever way to use setRotation? Any help greatly appreciated...
To make more clear what I'm trying to do, see this page and run the demo:
Code: Select all
http://www.codeproject.com/opengl/glenabledview.asp