Ok. Thanks for the info about the camera target coordinate position.
For the test application it's on the SVN site. First-king.
[EDIT] Also updated the binary and source from the download page at sourceforge.
I would like to keep the camera upvector intact. Would surely want to have the camera look upside down or tilt the view.
I think I could store the base UpVector somewhere and then do the manipulation over it.
It's will be easy to TILT the camera upvector if the local axis match the global axis, but they dont. I have to account for the rotation of the node (camera) then rotate a LOCAL Z axis.
[EDIT] Hi! Solved the problem!!!
This was easy, but I coulnt figure it out.
Here is the solution:
1. Define a standard UPVECTOR
2. Rotate this vector on the Z Axis for the desired TILT rotation
3. Rotate this vector again but on the Y axis of the current camera Y rotation.
Here what it look like in code:
Code: Select all
vector3df upv = vector3df(0,1,0);
upv.rotateXYBy(RelativeRotation.Z,vector3df(0,0,0));
upv.rotateXZBy(-RelativeRotation.Y,vector3df(0,0,0));
cam->setUpVector(upv);
Remark: For an unknown reason, I had to reverse the Y rotation because the tilt angle was inverted when the cam was on rotated in certain angle. Inversing the Y rotation value solved the problem.
Using that like this, I'm not sure if the base upvector was not (0,1,0), it would work again (Would like to permit to "walk" on ceiling or wall, or still have the option to do so.)