Jump to content
  • Advertisement
Sign in to follow this  
neodingo

Wireframe drawing

This topic is 4815 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

Alrighty, here we go again. I'm working on building a very basic model class, currently it just supports colored quads and tris, like I said, very basic. Anyways, I keep 2 vectors, one of quads and another of triangles. Inside of my render code it does a glBegin(GL_QUADS), runs through the quads vector, and repeats for the triangles. The rendering is just dandy, looks good, its the shapes I want and expect. Now I am trying to implement wireframe rendering, so my first thought was to use the points in all the quads and tris with glBegin(GL_LINE_STRIP) and I'm getting odd results. The lines are all there for all the edges, but some of the faces of the quads have lines going through the cross wise, like this:
 -------
|\      |
|  \    |
|    \  |
|_____ \|
And some of them even have lines making a full X, any ideas ?

Share this post


Link to post
Share on other sites
Advertisement
Why not just do:

glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );

That will enable proper wireframe mode.

Share this post


Link to post
Share on other sites
Wow...talk about way easier than what I thought...haha thanks, but out of curiosity, how do you get it back to normal shaded/textured mode ?

Share this post


Link to post
Share on other sites
Thanks again guys, I'm in the process of learning OpenGL and have yet to afford a decent book. Luckily between NeHe, GD.net, and google :) I have managed to make it this far. Hopefully I can continue before I have to go back to MTU. Rating++ on both of you.

Share this post


Link to post
Share on other sites
Quote:
Original post by neodingo
Thanks again guys, I'm in the process of learning OpenGL and have yet to afford a decent book. Luckily between NeHe, GD.net, and google :) I have managed to make it this far. Hopefully I can continue before I have to go back to MTU. Rating++ on both of you.
I recommend getting the OpenGL Programming Guide (AKA: the Red Book) as your first book. There's an older version online here, but I recommend buying the newest version when you can.

Also, add OpenGL.org to your list of websites for OpenGL info.

Share this post


Link to post
Share on other sites
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!