Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: GL_TRIANGLE_STRIP Algorithms anyone??

  1. #1
    Intern Contributor
    Join Date
    Oct 2003
    Posts
    99

    GL_TRIANGLE_STRIP Algorithms anyone??

    i am looking for a nice generic piece of code to render terrain using GL_TRIANGLE_STRIPS. for instance if you have an array of structs, each member of the struct contains an x , y , z coordinate and i store them into this array of structs what would be a good way of using glVertex3f to draw the terrain using the above mentioned? .. thanks so much in advance?

    oh yeah here is my problem. i have some data, 204*100;

    in mydata for example i have stored all the info. the first element would be..

    myData.x[0], myData.y[0], myData.depth[0].

    where 0 goes from 0 - (204*100); i would like to use GL_TRIANGLE_STRIPS to draw them out.. thanks you guys so much in advance!

  2. #2
    Intern Contributor
    Join Date
    Feb 2004
    Posts
    98

    Re: GL_TRIANGLE_STRIP Algorithms anyone??

    If the x, and y coordinates are organized on a grid you can march up and down the columns adding the corners of each row to the vertex list.
    You may have better luck using indexes, and the corresponding functions.

    If it's not on a regular grid then, you need to try to planarize the graph. Then try to convert the planar graph to psuedo-grid coordinates. Then march up and down the pseudo-grid columns.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •