Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  WireFrame Display  (Read 837 times)
0 Members and 2 Guests are viewing this topic.
Offline anil

JGO n00b
*

Posts: 25



« on: 2008-04-24 02:48:53 »

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
       
Offline dishmoth

JGO Ninja
***

Posts: 517
Medals: 19



« Reply #1 on: 2008-04-24 04:20:30 »

You could try
1  
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

Offline anil

JGO n00b
*

Posts: 25



« Reply #2 on: 2008-04-24 09:43:36 »

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.
Games published by our own members! Go get 'em!
Offline dishmoth

JGO Ninja
***

Posts: 517
Medals: 19



« Reply #3 on: 2008-04-24 12:00:46 »

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
1  
2  
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

Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.083 seconds with 18 queries.