Exemplo n.º 1
0
//----------------------------------------------------------
void ofGLRenderer::draw( const of3dPrimitive& model, ofPolyRenderMode renderType)  const{
	if(model.isUsingVbo()){
		model.getMesh().draw(renderType);
	}else{
		draw(model.getMesh(),renderType);
	}
}
//----------------------------------------------------------
void ofCairoRenderer::draw( const of3dPrimitive& model, ofPolyRenderMode renderType  )  const{

	const_cast<ofCairoRenderer*>(this)->pushMatrix();
	const_cast<ofCairoRenderer*>(this)->multMatrix(model.getGlobalTransformMatrix());

    const ofMesh& mesh = model.getMesh();
    draw( mesh, renderType );

	const_cast<ofCairoRenderer*>(this)->popMatrix();

}
Exemplo n.º 3
0
//----------------------------------------------------------
void ofGLRenderer::draw( of3dPrimitive& model, ofPolyRenderMode renderType) {
	// FIXME: we don't need this anymore since GL_NORMALIZE is enabled on lighting
	// leaving it comented just in case. it's also safe to remove this method completely
	// from the renderers hierarchy

    /*bool normalsEnabled = glIsEnabled( GL_NORMALIZE );
    if(model.hasScaling() && model.hasNormalsEnabled()) {
        if(!normalsEnabled) glEnable( GL_NORMALIZE );
    }*/

    model.getMesh().draw(renderType);

    /*if(model.hasScaling() && model.hasNormalsEnabled()) {
        if(!normalsEnabled) glDisable( GL_NORMALIZE );
    }*/

}
//----------------------------------------------------------
void ofCairoRenderer::draw( of3dPrimitive& model, ofPolyRenderMode renderType  ) {

    if(model.hasScaling()) {
        ofLogWarning("ofCairoRenderer") << "draw(): cairo mesh rendering doesn't support scaling";
        //glEnable( GL_NORMALIZE );
        //glPushMatrix();
        //ofVec3f scale = model.getScale();
        //glScalef( scale.x, scale.y, scale.z);
    }

    ofMesh& mesh = model.getMesh();
    draw( mesh, renderType, mesh.usingColors(), mesh.usingTextures(), mesh.usingNormals() );

    if(model.hasScaling()) {
        //glPopMatrix();
        //glDisable( GL_NORMALIZE );
    }

}