Changing Polygons to Wireframes

I’ve written the drawing code like this:


        gl.color3f(1.0f, 1.0f, 1.0f);
        gl.begin(GL.TRIANGLE_FAN);
            gl.vertex3f(20.0f, 30.0f, 200.0f);
            gl.vertex3f(20.0f, 40.0f, 0.0f);
            gl.vertex3f(60.0f, 30.0f, -20.0f);
            gl.vertex3f(40.0f, -20.0f, -10.0f);
            gl.vertex3f(20.0f, 40.0f, 0.0f);
        gl.end();
        
        gl.begin(GL.TRIANGLE_FAN);
            gl.vertex3f(-20.0f, 30.0f, 200.0f);
            gl.vertex3f(-20.0f, 40.0f, 0.0f);
            gl.vertex3f(-60.0f, 30.0f, -20.0f);
            gl.vertex3f(-40.0f, -20.0f, -10.0f);
            gl.vertex3f(-20.0f, 40.0f, 0.0f);
        gl.end();

And of course, something doesn’t look right (in other parts; this part is fine… Just an example of how I’m writing it).

Is there a way to change these to wire-frames instead of color-filled-polygons without writing out each line manually?

Thanks.

Very easy:

Just put gl.polygonMode(GL.FRONT_AND_BACK, GL.LINE) to view in wireframe mode, and to switch back to solid mode, use gl.polygonMode(GL.FRONT_AND_BACK, GL.FILL)… 8)

++
Chman

Thanks. You kick ass! :smiley:

And it almost worked the very first time I tried to compile it, but I got the semi-colon of death error. :’(