本文整理汇总了C++中Matrix44f::Determinant方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix44f::Determinant方法的具体用法?C++ Matrix44f::Determinant怎么用?C++ Matrix44f::Determinant使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix44f
的用法示例。
在下文中一共展示了Matrix44f::Determinant方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: decorateDoc
void DecorateBackgroundPlugin::decorateDoc(QAction *a, MeshDocument &m, RichParameterSet * parset,GLArea *gla, QPainter *, GLLogStream &)
{
static QString lastname("unitialized");
switch(ID(a))
{
case DP_SHOW_CUBEMAPPED_ENV :
{
if(!cm.IsValid() || (lastname != cubemapFileName ) )
{
qDebug( "Current CubeMapPath Dir: %s ",qPrintable(cubemapFileName));
glewInit();
bool ret = cm.Load(qPrintable(cubemapFileName));
lastname=cubemapFileName;
if(! ret ) return;
//QMessageBox::warning(gla,"Cubemapped background decoration","Warning unable to load cube map images: " + cubemapFileName );
cm.radius=10;
}
if(!cm.IsValid()) return;
Matrix44f tr;
glGetv(GL_MODELVIEW_MATRIX,tr);
// Remove the translation from the current matrix by simply padding the last column of the matrix
tr.SetColumn(3,Point4f(0,0,0,1.0));
//Remove the scaling from the the current matrix by adding an inverse scaling matrix
float scale = 1.0/pow(tr.Determinant(),1.0f/3.0f);
Matrix44f Scale;
Scale.SetDiagonal(scale);
tr=tr*Scale;
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
cm.DrawEnvCube(tr);
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
} break;
case DP_SHOW_GRID :
{
emit this->askViewerShot("me");
Box3f bb=m.bbox();
float scaleBB = parset->getFloat(BoxRatioParam());
float majorTick = parset->getFloat(GridMajorParam());
float minorTick = parset->getFloat(GridMinorParam());
bool gridSnap = parset->getBool(GridSnapParam());
bool backFlag = parset->getBool(GridBackParam());
bool shadowFlag = parset->getBool(ShowShadowParam());
Color4b backColor = parset->getColor4b(GridColorBackParam());
Color4b frontColor = parset->getColor4b(GridColorFrontParam());
bb.Offset((bb.max-bb.min)*(scaleBB-1.0));
DrawGriddedCube(*m.mm(),bb,majorTick,minorTick,gridSnap,backFlag,shadowFlag,backColor,frontColor,gla);
} break;
}
}