How to set nodes' origin?
How to set nodes' origin?
How can I set a node's origin? I mean the point wich it rotates around. I'd like to use it for a TPS camera, the camera parented to the character and both rotated by the mouse.
You can either create an empty scene node (See this) then make the scene node a child of the character and the camera a child of the empty scene node. THen rotate the empty scene node.
Or you can use some trig to figure out where the camera would be.
~DtD
Or you can use some trig to figure out where the camera would be.
~DtD
It worked
It worked nicely, one thing to note is you have to update the camera's target if you rotate it .
EDIT: Well after a bit testing i found that I will have to use some complicated maths to calculate the rotation on the vertical plane do you know anything to bypass this? I'm not in the mood to write geometrical maths...
EDIT: Well after a bit testing i found that I will have to use some complicated maths to calculate the rotation on the vertical plane do you know anything to bypass this? I'm not in the mood to write geometrical maths...
I can't work it out
I can't work out how to calculate the rotation on the vertical plane. Can't anybody give me some help??? The problem is that this vertival plane I have to rotate te camera on is changed by the rotation on the vertical axis.
I got this thing with my medicore maths knowledge:
rotX/rotZ=tan(rotY)
I dont event know if it's good or not because I cant calculate it.
I got this thing with my medicore maths knowledge:
rotX/rotZ=tan(rotY)
I dont event know if it's good or not because I cant calculate it.
try rogerborgs quaternion rotation sample, works for me...
http://irrlicht.sourceforge.net/phpBB2/ ... n+rotation
http://irrlicht.sourceforge.net/phpBB2/ ... n+rotation