本文整理汇总了C++中Matrix4d::Transpose方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4d::Transpose方法的具体用法?C++ Matrix4d::Transpose怎么用?C++ Matrix4d::Transpose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix4d
的用法示例。
在下文中一共展示了Matrix4d::Transpose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_Matrix
bool test_Matrix() {
Matrixd a = { {1, 4, 9},
{6, 4, 2},
{8, 0, 3},
{3, 3, 8} };
Matrixd b = {{6.0000, 7.0000, 12.5000, -88.3423},
{2.0000, -8.1100, 3.1415, 4.7000},
{0.1250, -2.3390, 3.5820, 98.3810} };
Matrixd a_t_b = {{15.125, -46.491, 57.304, 815.88666},
{44.25, 4.882, 94.73, -314.49204},
{48.375, 48.983, 110.746, -411.59572},
{25, -22.042, 75.5805, 536.12098} };
Matrixd a_t_777 = {{7.7700, 31.0800, 69.9300},
{46.6200, 31.0800, 15.5400},
{62.1600, 0, 23.3100},
{23.3100, 23.3100, 62.1600}};
Matrixd b_t_a = {{-117.0270, -213.0270, -601.2387},
{-7.4280, -10.3400, 48.8045},
{309.8900, 286.2870, 794.2410}};
// (a*b).ShowMatrix();
assert((a * b) == a_t_b);
assert((a * 7.77) == a_t_777);
assert((b * a) == b_t_a);
assert((-a * 1.0) == a * -1.0);
assert(-(-(a * 1.0)) == a);
assert(a * -1.0 == -1.0 * a);
assert(Matrixd::Identity(4) * a_t_b == a_t_b);
assert(Matrixd::Zeros(3, 4) * a == Matrixd::Zeros(3, 3));
cout<<"Matrixd passed Test!"<<endl;
Matrix4d m = { { 1, 2, 3, 4}, {5, 6, 7, 8},
{9, 10, 11, 12}, {13, 14, 15, 16} };
assert(m.Transpose().Transpose() == m);
assert(!(m.Transpose() == m));
return true;
}
示例2: RenderStaticModels
void ModelDisplayState::RenderStaticModels(RenderOptions& options) const
{
const std::vector<CompositeModel3d::StaticModelData>& vecStaticModels =
m_spModel->StaticList();
ATLASSERT(m_vecStaticModelTextures.size() == vecStaticModels.size());
for (size_t i=0, iMax = vecStaticModels.size(); i<iMax; i++)
{
// enable model texture, if loaded
if (m_vecStaticModelTextures[i] != NULL)
m_vecStaticModelTextures[i]->Bind();
// find mount point and matrix
const CompositeModel3d::StaticModelData& data = vecStaticModels[i];
ATLASSERT(data.m_iJointIndex >= 0);
ATLASSERT(size_t(data.m_iJointIndex) < m_vecJointRenderData.size());
size_t uiMountIndex = static_cast<size_t>(data.m_iJointIndex);
Matrix4d matGlobal = m_vecJointRenderData[uiMountIndex].GlobalMatrix();
matGlobal.Transpose();
// transform current modelview matrix
glPushMatrix();
glMultMatrixd(matGlobal.Data());
// render model
data.m_spStatic->Render(options);
// render mount point
if (options.Get(RenderOptions::optionModelJoints))
RenderMountPoint();
glPopMatrix();
}
}