WireFrame Display

Hi all,

      I have displayed a object as a solid view, now I want to display it as a wireframe using JOGL. Can any one please tell me how can I achieve this.
      Are there any API's available for this, or what is the way to do this.
     Thanks in advance.

Anil

You could try

gl.glPolygonMode(GL.GL_FRONT, GL.GL_LINE);

for starters. Polygons appear solid with GL_FILL while GL_LINE just draws the outline.

Is this the sort of thing you’re after?

Simon

Thanks dishmoth,
I was able to display the wireframe mode of image using gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_LINE); Your suggestion was really helpful.

I have one more doubt. I am trying to switch between the wireframe mode and solid mode of the image on left and right mouse event click. But I am unable to switch between the two modes.

what I have did is set the value GL.GL_FILL on left click and GL.GL_FRONT_AND_BACK on right click for a variable which is passed as a first argument for the method
gl.glPolygonMode. And then I have called display() on the GLPanel which displays the image.

Please guide me where I am wrong.

Thanks in advance.

Hi, Anil.

What you’re describing should work, as far as I can see.

You could try checking that glPolygonMode is being called in the way you expect. For example, for you could put in code like

gl.glPolygonMode(A, B);
System.out.println("glPolygonMode " + A + " " + B);

at every point where you call the function. Then check that the arguments change when you click the mouse.

Good luck!
Simon