Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualHornsj3

Posted 04 July 2012 - 06:43 AM

The orientation is determined by where the camera is looking, i.e. the target vector, and the up direction.

If your camera is rolling you create the quaternion for rotation about the target vector. You can then multiply the current up vector by that quaternion, and then that result by the conjugate of the quaternion (same as the inverse of a quaternion if the quaternion's vector component is uniform). This will give you a new up vector which will be in a direction which corresponds to the rotation about the target axis. Follow the example above for roll.

The view matrix can then be created using the

XMMatrixLookToLH( m_camPosition, m_camTarget, m_camUp) function.


#1Hornsj3

Posted 04 July 2012 - 06:41 AM

The orientation is determined by where the camera is looking, i.e. the target vector, and the up direction.

If your camera is rolling you create the quaternion for rotation about the target vector. You can then multiply the current up vector by that quaternion, and then that result by the conjugate of the quaternion (same as the inverse of a quaternion if the quaternion's vector component is uniform). Follow the example above for roll.

The view matrix can then be created using the

XMMatrixLookToLH( m_camPosition, m_camTarget, m_camUp) function.


PARTNERS