Results 1 to 4 of 4

Thread: wireframe?

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2001
    Location
    UK
    Posts
    10

    wireframe?

    Hi there,

    I have just been told I should use a wireframe method to display my terrain instead of triangles. The file that I am reading data from has latitude, longitude and height values. Do you know how I could find out about a wireframe method of doing this? Thanks

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Dec 2007
    Posts
    1,077

    Re: wireframe?

    Simply call
    glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );

    This will display the triangles as wireframe. However this is not the most efficient way, since you're drawing each edge twice. But it's the simplest.

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2001
    Location
    UK
    Posts
    10

    Re: wireframe?

    Thanks for that, but I meant I should do it in a grid method with gridlines,but don't know how to do this,any suggestions or guidelines?,Sorry,I should have been more specific.Thanks

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Dec 2007
    Posts
    1,077

    Re: wireframe?

    Well, I assume you have a grid of height-values. Then do this:

    Code :
    for( i=0; i<grid_height; i++ ) {
       glBegin( GL_LINE_STRIP );
     
       for( j=0; j<grid_width; j++ ) {
          glVertex3f( x of grid[i][j], grid[i][j], z of grid[i][j] );
       }
       glEnd();
    }
     
    for( i=0; i<grid_width; i++ ) {
       glBegin( GL_LINE_STRIP );
     
       for( j=0; j<grid_height; j++ ) {
          glVertex3f( x of grid[j][i], grid[j][i], z of grid[j][i] );
       }
       glEnd();
    }
    Shouldn'T do that the trick?

Similar Threads

  1. Wireframe in GL3
    By Jan in forum OpenGL: Advanced Coding
    Replies: 17
    Last Post: 12-19-2008, 04:42 PM
  2. wireframe
    By OGforever in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-24-2005, 10:57 PM
  3. no wireframe?
    By in forum OpenGL: Linux
    Replies: 1
    Last Post: 11-15-2002, 09:10 AM
  4. Wireframe
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 06-11-2002, 09:11 AM
  5. Wireframe
    By Rottbott in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-25-2001, 06:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean