本文整理汇总了C++中Matrix44f::scale方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix44f::scale方法的具体用法?C++ Matrix44f::scale怎么用?C++ Matrix44f::scale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix44f
的用法示例。
在下文中一共展示了Matrix44f::scale方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawIntoRoomFbo
void BubbleChamberApp::drawIntoRoomFbo()
{
mRoomFbo.bindFramebuffer();
gl::clear( ColorA( 0.0f, 0.0f, 0.0f, 0.0f ), true );
gl::setMatricesWindow( mRoomFbo.getSize(), false );
gl::setViewport( mRoomFbo.getBounds() );
gl::disableAlphaBlending();
gl::enable( GL_TEXTURE_2D );
glEnable( GL_CULL_FACE );
glCullFace( GL_BACK );
Matrix44f m;
m.setToIdentity();
m.scale( mRoom.getDims() );
mRoomShader.bind();
mRoomShader.uniform( "mvpMatrix", mActiveCam.mMvpMatrix );
mRoomShader.uniform( "mMatrix", m );
mRoomShader.uniform( "eyePos", mActiveCam.mCam.getEyePoint() );
mRoomShader.uniform( "roomDims", mRoom.getDims() );
mRoomShader.uniform( "power", mRoom.getPower() );
mRoomShader.uniform( "lightPower", mRoom.getLightPower() );
mRoomShader.uniform( "timePer", mRoom.getTimePer() * 1.5f + 0.5f );
mRoom.draw();
mRoomShader.unbind();
mRoomFbo.unbindFramebuffer();
glDisable( GL_CULL_FACE );
}
示例2: drawIntoRoomFbo
void ShadedSphereApp::drawIntoRoomFbo()
{
mRoomFbo.bindFramebuffer();
gl::clear( ColorA( 0.0f, 0.0f, 0.0f, 0.0f ), true );
gl::setMatricesWindow( mRoomFbo.getSize(), false );
gl::setViewport( mRoomFbo.getBounds() );
gl::disableAlphaBlending();
gl::enable( GL_TEXTURE_2D );
glEnable( GL_CULL_FACE );
glCullFace( GL_BACK );
Matrix44f m;
m.setToIdentity();
m.scale( mRoom.getDims() );
// mLightsTex.bind( 0 );
mRoomShader.bind();
mRoomShader.uniform( "mvpMatrix", mSpringCam.mMvpMatrix );
mRoomShader.uniform( "mMatrix", m );
mRoomShader.uniform( "eyePos", mSpringCam.getEye() );
mRoomShader.uniform( "roomDims", mRoom.getDims() );
mRoomShader.uniform( "mainPower", mRoom.getPower() );
mRoomShader.uniform( "lightPower", mRoom.getLightPower() );
mRoom.draw();
mRoomShader.unbind();
mRoomFbo.unbindFramebuffer();
glDisable( GL_CULL_FACE );
}
示例3: getTransformMatrix
ci::Matrix44f CollisionObject::getTransformMatrix() const
{
Matrix44f worldTransform;
if ( mSoftBody != 0 ) {
worldTransform = getTransformMatrix( mSoftBody );
} else if ( mRigidBody != 0 ) {
worldTransform = getTransformMatrix( mRigidBody );
}
worldTransform.scale( mScale );
return worldTransform;
}
示例4: setup
void MeshViewApp::setup()
{
loadConfig("configs/gaztank.ini");
setupCamera();
// Create lights
m_light1 = new gl::Light(gl::Light::DIRECTIONAL, 0);
m_light1->setDirection(Vec3f(0, 0, 1).normalized());
m_light1->setAmbient(Color(0.0f, 0.0f, 0.1f));
m_light1->setDiffuse(Color(0.9f, 0.6f, 0.3f));
m_light1->setSpecular(Color(0.9f, 0.6f, 0.3f));
m_light2 = new gl::Light(gl::Light::DIRECTIONAL, 1);
m_light2->setDirection(Vec3f(0, 0, -1).normalized());
m_light2->setAmbient(Color(0.0f, 0.0f, 0.0f));
m_light2->setDiffuse(Color(0.2f, 0.6f, 1.0f));
m_light2->setSpecular(Color(0.2f, 0.2f, 0.2f));
// Setup matrix
m_matrix.setToIdentity();
m_matrix.translate(Vec3f::zero());
m_matrix.rotate(Vec3f::zero());
m_matrix.scale(Vec3f::one());
m_rotateMesh = false;
// Create a parameter window
m_params = params::InterfaceGl::create(getWindow(), "Properties", Vec2i(180, 240));
m_params->addText("LMB + drag - rotate");
m_params->addText("RMB + drag - zoom");
m_params->addSeparator();
m_params->addButton("Full screen", [&] { setFullScreen(!isFullScreen()); });
m_params->addParam("Auto rotate", &m_rotateMesh);
m_params->addSeparator();
m_params->addParam("Diffuse", &m_diffuseEnabled);
m_params->addParam("Normal", &m_normalEnabled);
m_params->addParam("Specular", &m_specularEnabled);
m_params->addParam("AO", &m_aoEnabled);
m_params->addParam("Emissive", &m_emissiveEnabled);
m_params->addSeparator();
m_params->addParam("Gamma", &m_gamma, "min=0.0 max=10.0 step=0.1");
m_time = (float)getElapsedSeconds();
}