Matrix44 Camera::getViewMatrix() { Matrix44 viewMatrix; viewMatrix.LoadIdentity(); viewMatrix.LookAt(m_eyePosition, m_nVector, m_upVector); return viewMatrix; }
Matrix44 Camera::getModelMatrix() { Matrix44 modelMatrix; modelMatrix.LoadIdentity(); modelMatrix.Scalef(m_scale.x, m_scale.y, m_scale.z); // 等以后需要时再加入旋转变换/ modelMatrix.Translatef(m_worldPos.x, m_worldPos.y, m_worldPos.z); return modelMatrix; }
Matrix44 Camera::getNormTransformMatrix() { // 光照计算放在世界坐标下计算,故直接使用单位矩阵/ //Matrix44 viewMatrix; //viewMatrix.LoadIdentity(); //viewMatrix.LookAt(m_eyePosition, m_nVector, m_upVector); //viewMatrix.Inverse(); //Matrix44 result = viewMatrix.GetTranspose(); Matrix44 result; return result.LoadIdentity(); }