Aug 11, 2008 at 3:16 PM
Edited Aug 11, 2008 at 3:17 PM
Using 3DTools, how do I calculate the
world xyz of the camera (original camera.position + rotation) after any Track occurs?
private void Track(Point currentPosition)
Quaternion delta =
new Quaternion(axis, -angle);
// Get the current orientation from the RotateTransform3D
AxisAngleRotation3D r = _rotation;
Quaternion q =
new Quaternion(_rotation.Axis, _rotation.Angle);
// Compose the delta with the previous orientation
q *= delta;
// Write the new orientation back to the Rotation3D
_rotation.Axis = q.Axis;
_rotation.Angle = q.Angle;
_previousPosition3D = currentPosition3D;
At this point I need the world xyz of the camera in order to handle key sphere rotations (eg rotate to the y-axis) because if I pan(translate) off of the original sphere my
key rotations are no longer centered on my origin.
In order to calculate the proper rotation I need the world coordinates of the camera,
not only the rotation or translate transforms.