void FlipOver::draw( ci::gl::GlslProg shader ){
	gl::pushModelView();

	gl::translate( mPosition );
	gl::rotate( mRotation );

	shader.uniform( "tex", 0 );
	gl::draw( mMesh );

	shader.uniform( "tex", 1 );
	gl::rotate( Vec3f( 0.0f, 180.0f, 0.0f ) );
	gl::draw( mMesh );

	gl::popModelView();
}
Exemple #2
0
// Render
void MeshApp::draw()
{

	// Set up window
	gl::clear( ColorAf::black(), true );
	gl::setMatrices( mCamera );
	gl::color( ColorAf::white() );

	// Check texture and VBO
	if ( mTextureDepth && mTextureColor && mVboMesh ) {

		// Position world
		gl::pushMatrices();
		gl::scale( -1.0f, -1.0f, -1.0f );
		gl::rotate( mRotation );

		// Bind textures
		mTextureDepth.bind( 0 );
		mTextureColor.bind( 1 );
		
		// Bind and configure shader
		mShader.bind();
		mShader.uniform( "brightTolerance",	mBrightTolerance 						);
		mShader.uniform( "eyePoint",		mEyePoint 								);
		mShader.uniform( "lightAmbient",	mLightAmbient 							);
		mShader.uniform( "lightDiffuse",	mLightDiffuse 							);
		mShader.uniform( "lightPosition",	mLightPosition 							);
		mShader.uniform( "lightSpecular",	mLightSpecular 							);
		mShader.uniform( "positions",		0 										);
		mShader.uniform( "scale",			mScale 									);
		mShader.uniform( "showColor",		mShowColor 								);
		mShader.uniform( "shininess",		mLightShininess 						);
		mShader.uniform( "Color",			1 										);
		mShader.uniform( "ColorOffset",		Vec2f( mColorOffsetX, mColorOffsetY )	);
		mShader.uniform( "uvmix",			mMeshUvMix								);

		// Draw VBO
		gl::draw( mVboMesh );

		// Stop drawing
		mShader.unbind();
		mTextureDepth.unbind();
		mTextureColor.unbind();
		gl::popMatrices();

	}

	// Draw params
	params::InterfaceGl::draw();

}