Jump to content
  • Advertisement
Sign in to follow this  
daniel_i_l

OpenGL drawing an outline

This topic is 4287 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a few 3D boxes that are draws as 6 quads, I want to draw them with a border around them so that it would be easier to tell them apart. so I did:
glColor3f(0.5, 0.5, 0.5);
glLineWidth(3.0f);
 float aM[16];
for(unsigned int i=0; i<Bodies.size(); ++i)
{
    glLoadIdentity();
    glPushMatrix();
    CreateOpenGLTransform(Bodies.MyState.Orientation, Bodies
.MyState.Position, aM);
    glMultMatrixf(aM);

    //draw outline        
    glDisable(GL_LIGHTING);
    glColor3f(1,0,0);
    glPolygonMode(GL_FRONT_AND_BACK, GL_LINES);
    Bodies.GetGeometry()->Render();
	
    //draw box		
    glEnable(GL_LIGHTING);
    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
    glColor3f(1.0, 0.8, 0.5);
    Bodies.GetGeometry()->Render();
			
    glPopMatrix();
		
}

but for some reason it just rendered the outline as a regular box! what could be the problem? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!