Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualMedo3337

Posted 19 December 2012 - 12:29 AM

@L. Spiro: The code I'm using to change "Pitch":
void Camera::pitch(float radians)
{
	 radians = (m_invertY) ? -radians : radians;
	 m_pitch -= radians;
	 if (m_pitch > m_maxPitch)
	 {
		  radians += m_pitch - m_maxPitch;
	 }
	 else if (m_pitch < -m_maxPitch)
	 {
		  radians += m_pitch + m_maxPitch;
	 }

	 D3DXMATRIX matRotation;
	 D3DXMatrixRotationAxis( &matRotation, &m_right, radians );
	 D3DXVec3TransformNormal( &m_up, &m_up, &matRotation );
	 D3DXVec3TransformNormal( &m_look, &m_look, &matRotation );
}

​I'm not sure how I can use the way you mentioned, maybe you can explain more programmatically instead of mathematically.

#1Medo3337

Posted 19 December 2012 - 12:22 AM

@L. Spiro: The code I'm using to change "Pitch":
void Camera::pitch(float radians)
{
     radians = (m_invertY) ? -radians : radians;
     m_pitch -= radians;
     if (m_pitch > m_maxPitch)
     {
          radians += m_pitch - m_maxPitch;
     }
     else if (m_pitch < -m_maxPitch)
     {
          radians += m_pitch + m_maxPitch;
     }

     D3DXMATRIX matRotation;
     D3DXMatrixRotationAxis( &matRotation, &m_right, radians );
     D3DXVec3TransformNormal( &m_up, &m_up, &matRotation );
     D3DXVec3TransformNormal( &m_look, &m_look, &matRotation );
}

​I'm not sure how I can use the way you mentioned, maybe you can explain more programmatically instead ofmathematically.

PARTNERS