#160236 - JYC376 - Sat Jul 12, 2008 3:56 pm
I've looked into outlining for NDS (glEnable(GL_OUTLINE), glSetOutlineColor, blah blah blah), but I want something like this:
[Images not permitted - Click here to view it]
Instead of having an outline around the whole group of polygons. The code I used (on Linux/Win/OSX):
When I just have GL_OUTLINE and one group of polygons, the whole image would look flat, as if the the center pillar is a bridge between the two sides (sorry, my cam isn't working right now).
I've made the game figure out different polyIDs for each square/pillar, but I would like a better solution.
Thanks.
Oh, and the code and binaries.
The NDS stuff are named n-echo and the Linux/Win/OSX are named l-echo.
[Images not permitted - Click here to view it]
Instead of having an outline around the whole group of polygons. The code I used (on Linux/Win/OSX):
Code: |
// Push the GL attribute bits so that we don't wreck any settings
glPushAttrib( GL_ALL_ATTRIB_BITS ); // Enable polygon offsets, and offset filled polygons forward by 2.5 glEnable( GL_POLYGON_OFFSET_FILL ); glPolygonOffset( -2.5f, -2.5f ); // Set the render mode to be line rendering with a thick line width glPolygonMode( GL_FRONT_AND_BACK, GL_LINE ); glLineWidth( 3.0f ); // Set the colour to be white glColor3f( 1.0f, 1.0f, 1.0f ); // Render the object RenderMesh3(); // Set the polygon mode to be filled triangles glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); glEnable( GL_LIGHTING ); // Set the colour to the background glColor3f( 0.0f, 0.0f, 0.0f ); // Render the object RenderMesh3(); // Pop the state changes off the attribute stack // to set things back how they were glPopAttrib(); |
When I just have GL_OUTLINE and one group of polygons, the whole image would look flat, as if the the center pillar is a bridge between the two sides (sorry, my cam isn't working right now).
I've made the game figure out different polyIDs for each square/pillar, but I would like a better solution.
Thanks.
Oh, and the code and binaries.
The NDS stuff are named n-echo and the Linux/Win/OSX are named l-echo.