本文整理汇总了C++中Matrix3::Translate方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix3::Translate方法的具体用法?C++ Matrix3::Translate怎么用?C++ Matrix3::Translate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix3
的用法示例。
在下文中一共展示了Matrix3::Translate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ImportTransform
bool CollisionImport::ImportTransform(INode *rbody, bhkRigidBodyRef body, bhkTransformShapeRef shape, INode *parent, Matrix3& tm)
{
Matrix44 m4 = shape->GetTransform().Transpose();
Vector3 trans; Matrix33 rot; float scale;
m4.Decompose(trans, rot, scale);
Matrix3 wm = TOMATRIX3(rot);
wm.Translate(TOPOINT3(trans) * ni.bhkScaleFactor);
wm *= ScaleMatrix(Point3(scale, scale, scale));
wm = wm * tm;
return ImportShape(rbody, body, shape->GetShape(), parent, wm);
}
示例2: pen
DWORD TestView::onRender()
{
DWORD dwTickCount = ::GetTickCount();
Pen pen;
pen.setColor(30, 30, 30);
_pPainter->rotate( _pPainter->getRotate());
_pPainter->renderBegin(pen);
// draw grids
{
Pen pen;
pen.setColor(50, 50, 50);
//10mm
_pPainter->drawBegin(pen);
for (float i = -200; i <= 200; i+=10)
_pPainter->drawLine( i, 200, i, -200);
_pPainter->drawEnd();
_pPainter->drawBegin(pen);
for (float i = -200; i <= 200; i+=10)
_pPainter->drawLine( -200, i, 200, i);
_pPainter->drawEnd();
}
// draw axis
{
Pen pen;
pen.setColor(255, 0, 0);
_pPainter->drawBegin(pen);
_pPainter->drawLine( -200,0, 200,0);
_pPainter->drawEnd();
pen.setColor(0, 255, 0);
_pPainter->drawBegin(pen);
_pPainter->drawLine( 0, 200, 0, -200);
_pPainter->drawEnd();
}
// draw entities
{
for(int i=0; i< 11; ++i)
{
for(int j=0; j< 11; ++j)
{
Matrix3 m;
m.Translate( -100 +20*j, 100 - i*20);
Pen pen(255, 255, 255);
_pPainter->drawBegin(pen, m);
_pPainter->drawRectangle( -7, 7, 7, -7);
_pPainter->drawRectangle( -5, 5, 5, -5, true);
_pPainter->drawEnd();
}
}
}
_pPainter->renderEnd();
return ::GetTickCount() - dwTickCount;
}