Beispiel #1
0
        private void UpdateGeometry()
        {
            // create orthornormal basis from lookAt and up vectors
            m_lookAt = m_lookAtPoint - m_eye;
            m_lookAt.Normalize();

            m_right = Vec3F.Cross(m_lookAt, m_up);
            m_right.Normalize();

            m_up = Vec3F.Cross(m_right, m_lookAt);
            //m_up.Normalize(); // m_right is already unit length

            m_lookAtDistance = Vec3F.Distance(m_eye, m_lookAtPoint);

            if (ProjectionType == ProjectionType.Orthographic)
            {
                SetOrthographic(m_lookAtDistance);
            }
            else
            {
                OnCameraChanged(EventArgs.Empty);
            }
        }