本文整理汇总了C++中Matrix4d::translate方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4d::translate方法的具体用法?C++ Matrix4d::translate怎么用?C++ Matrix4d::translate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix4d
的用法示例。
在下文中一共展示了Matrix4d::translate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateTexture
/** Store the Direct Volume Rendering of the dataset and store it in the
* texture buffer. */
void GLDvrWidget::updateTexture() {
assert(mp_volume);
assert(mp_transferFunction);
// TODO (CA2): perform Direct Volume Rendering here
Vector3d C00 = Vector3d(0,0,0);
Vector3d C01 = Vector3d(0,m_texHeight,0);
Vector3d C10 = Vector3d(m_texWidth,0,0);
Vector3d C11 = Vector3d(m_texWidth,m_texHeight,0);
Matrix4d rotate;
rotate = m_matRotX * m_matRotY;
Matrix4d scale;
scale.scale(Vector3d(m_prevMouseScale,m_prevMouseScale,m_prevMouseScale));
int m_maxDim = m_texHeight;
Matrix4d T;
T.translate(Vector3d(mp_volume->getWidth(),mp_volume->getHeight(),mp_volume->getDepth()));
Matrix4d Tv_center = T.getTranslated( 0.5*Vector3d(mp_volume->getWidth(),mp_volume->getHeight(),mp_volume->getDepth())) ;
Matrix4d Tz = T.getTranslated(Vector3d(0.,0.,(double)(-2*m_maxDim)));
Matrix4d M = Tv_center*rotate*scale*Tz*Tv_center;
C00 *= M;
} /* updateTexture() */