本文整理汇总了C++中Matrix4::extract3x3Matrix方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4::extract3x3Matrix方法的具体用法?C++ Matrix4::extract3x3Matrix怎么用?C++ Matrix4::extract3x3Matrix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix4
的用法示例。
在下文中一共展示了Matrix4::extract3x3Matrix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calculateTransform
void NIFLoader::calculateTransform()
{
// Calculate transform
Matrix4 transform = Matrix4::IDENTITY;
transform = Matrix4::getScale(vector) * transform;
// Check whether we have to flip vertex winding.
// We do have to, if we changed our right hand base.
// We can test it by using the cross product from X and Y and see, if it is a non-negative
// projection on Z. Actually it should be exactly Z, as we don't do non-uniform scaling yet,
// but the test is cheap either way.
Matrix3 m3;
transform.extract3x3Matrix(m3);
if (m3.GetColumn(0).crossProduct(m3.GetColumn(1)).dotProduct(m3.GetColumn(2)) < 0)
{
mFlipVertexWinding = true;
}
mTransform = transform;
}
示例2:
void DemoApplication::SmoothCamera::Reset (const Vector3& posit, const Quaternion& rotation)
{
Matrix4 matrix;
matrix.makeTransform (posit, Vector3 (1.0f, 1.0f, 1.0f), rotation);
matrix = matrix.transpose();
Matrix3 rot;
matrix.extract3x3Matrix(rot);
Radian rotX;
Radian rotY;
Radian rotZ;
rot.ToEulerAnglesZYX (rotZ, rotY, rotX);
m_cameraYawAngle = rotY;
m_cameraPitchAngle = rotX;
m_cameraTranslation = posit;
ResetMatrix (&matrix[0][0]);
// Matrix4 cameraMatrix;
// InterplateMatrix (0.0f, cameraMatrix[0]);
}