本文整理汇总了C++中Viewpoint::applyTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewpoint::applyTransform方法的具体用法?C++ Viewpoint::applyTransform怎么用?C++ Viewpoint::applyTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewpoint
的用法示例。
在下文中一共展示了Viewpoint::applyTransform方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: applyTransform
void Light::applyTransform(int projection_nb)
{
if(m_type == OMNI)
{
Transformf trans(node()->getGlobalTransform());
float transx = -trans.getPosition().x;
float transy = -trans.getPosition().y;
float transz = -trans.getPosition().z;
glTranslatef(transx, transy, transz);
}
else if(m_type == SPOT)
{
node()->getGlobalTransform().getInverse().glMultd();
}
else if(m_type == SUN)
{
#ifdef MERGEFORSUN
return;
#endif
Viewpoint* targetVp = RENDER_MANAGER.getRenderPassInfo()->lod_viewpoint;
targetVp->applyTransform(projection_nb);
}
}
示例2: drawDebug
void Light::drawDebug(const GLWidget* widget, const RenderManager::DebugGizmosFilter& filter) const
{
if(filter.draw_lights)
{
widget->qglColor(Qt::yellow);
glBegin(GL_LINE_LOOP);
for(int i=0 ; i<360 ; i+=10) {
float sin = fastSin(i)/10;
float cos = fastCos(i)/10;
glVertex3d(0,sin,cos);
}
glEnd();
glBegin(GL_LINE_LOOP);
for(int i=0 ; i<360 ; i+=10) {
float sin = fastSin(i)/10;
float cos = fastCos(i)/10;
glVertex3d(sin,0,cos);
}
glEnd();
glBegin(GL_LINE_LOOP);
for(int i=0 ; i<360 ; i+=10) {
float sin = fastSin(i)/10;
float cos = fastCos(i)/10;
glVertex3d(sin,cos,0);
}
glEnd();
if(m_type == SPOT || m_type == SUN)
{
glPushMatrix();
if(m_type == SUN)
{
glLoadIdentity();
#ifndef MERGEFORSUN
Viewpoint* targetVp = RENDER_MANAGER.getRenderPassInfo()->lod_viewpoint;
targetVp->applyTransform(0);
#endif
}
Matrix4d mat;
if(m_type == SUN)
{
computePSSM(mat, 0);
}
else
{
computeLightFrustum(mat);
}
mat.invert();
glMultMatrixd(mat.values);
glBegin(GL_LINES);
glVertex3d(-1,-1,-1);
glVertex3d( 1,-1,-1);
glVertex3d(-1,-1,-1);
glVertex3d(-1, 1,-1);
glVertex3d(-1,-1,-1);
glVertex3d(-1,-1, 1);
glVertex3d( 1,-1,-1);
glVertex3d( 1, 1,-1);
glVertex3d( 1,-1,-1);
glVertex3d( 1,-1, 1);
glVertex3d(-1, 1,-1);
glVertex3d( 1, 1,-1);
glVertex3d(-1, 1,-1);
glVertex3d(-1, 1, 1);
widget->qglColor(Qt::red);
glVertex3d(-1,-1, 1);
glVertex3d( 1,-1, 1);
glVertex3d(-1,-1, 1);
glVertex3d(-1, 1, 1);
glVertex3d( 1, 1, 1);
glVertex3d(-1, 1, 1);
glVertex3d( 1, 1, 1);
glVertex3d( 1,-1, 1);
widget->qglColor(Qt::yellow);
glVertex3d( 1, 1, 1);
glVertex3d( 1, 1,-1);
glEnd();
glPopMatrix();
}
}
}