1

I have an .OBJ loader that load an object and renders it. I can render it as wireframe or solid, like this:

Solid

enter image description here

Wireframe

enter image description here

So now i would like to render both modes at the same time like - Wireframe render over the Solid render (both with different colors). Is that possible?

Can anyone help please? Thank you.

1 Answer 1

2

I figured it out! Here's the code if anyone has the same doubt i had :-)

// draw the filled polygons
   glPolygonMode( GL.GL_FRONT_AND_BACK, GL.GL_FILL );
   glEnable( GL.GL_POLYGON_OFFSET_FILL );
   glPolygonOffset( 1, 1 );
   glColor3f( 0.0f, 0.0f, 0.0f );
   renderData();
   gl.glDisable( GL.GL_POLYGON_OFFSET_FILL );

   // draw the wireframe
   glPolygonMode( GL.GL_FRONT_AND_BACK, GL.GL_LINE );
   glColor4fv( colour );
   renderData();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.