本文整理汇总了C++中GfMatrix4d::Factor方法的典型用法代码示例。如果您正苦于以下问题:C++ GfMatrix4d::Factor方法的具体用法?C++ GfMatrix4d::Factor怎么用?C++ GfMatrix4d::Factor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GfMatrix4d
的用法示例。
在下文中一共展示了GfMatrix4d::Factor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rotMat
static void
_ConvertMatrixToComponents(const GfMatrix4d &matrix,
GfVec3d *translation,
GfVec3f *rotation,
GfVec3f *scale)
{
GfMatrix4d rotMat(1.0);
GfVec3d doubleScale(1.0);
GfMatrix4d scaleOrientMatUnused, perspMatUnused;
matrix.Factor(&scaleOrientMatUnused, &doubleScale, &rotMat,
translation, &perspMatUnused);
*scale = GfVec3f(doubleScale[0], doubleScale[1], doubleScale[2]);
if (!rotMat.Orthonormalize(/* issueWarning */ false))
TF_WARN("Failed to orthonormalize rotation matrix.");
_RotMatToRotXYZ(rotMat, rotation);
}
示例2:
static void
_MatrixToVectorsWithPivotInvariant(
const GfMatrix4d &m,
const GfVec3d pivotPosition,
const GfVec3d pivotOrientation,
GfVec3d *translation,
GfVec3d *rotation,
GfVec3d *scale,
GfVec3d *scaleOrientation)
{
GfMatrix3d pivotOrientMat = _EulerXYZToMatrix3d(pivotOrientation);
GfMatrix4d pp = GfMatrix4d(1.0).SetTranslate( pivotPosition);
GfMatrix4d ppInv = GfMatrix4d(1.0).SetTranslate(-pivotPosition);
GfMatrix4d po = GfMatrix4d(1.0).SetRotate(pivotOrientMat);
GfMatrix4d poInv = GfMatrix4d(1.0).SetRotate(pivotOrientMat.GetInverse());
GfMatrix4d factorMe = po * pp * m * ppInv;
GfMatrix4d scaleOrientMat, factoredRotMat, perspMat;
factorMe.Factor(&scaleOrientMat, scale, &factoredRotMat,
translation, &perspMat);
GfMatrix4d rotMat = factoredRotMat * poInv;
if(not rotMat.Orthonormalize(/* issueWarning */ false))
TF_WARN("Failed to orthonormalize rotMat.");
_RotMatToRotTriplet(rotMat, rotation);
if(not scaleOrientMat.Orthonormalize(/* issueWarning */ false))
TF_WARN("Failed to orthonormalize scaleOrientMat.");
_RotMatToRotTriplet(scaleOrientMat, scaleOrientation);
}