Skip to main content
gamedev.net
🔒 Locked

Wireframe drawing

Started by neodingo 4 replies 1.9k views
Original Post
neodingo
neodingo
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 ?
Promit
Promit
Why not just do:
glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );

That will enable proper wireframe mode.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
neodingo
neodingo
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 ?
lancekt
lancekt
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );

Pretty straightforward. :)
Orin Tresnjak | Graphics ProgrammerBethesda Game StudiosStandard Disclaimer: My posts represent my opinions and not those of Bethesda/Zenimax, etc.
neodingo
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.
Kalidor
Kalidor
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.