Results 1 to 5 of 5

Thread: Opengl Question

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Posts
    4

    Opengl Question

    How do you create a terrain in opengl ?

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    The same way you make any other object

    Easiest way is to use a heightfield, say 10x10 nodes. Each of these nodes has a value from (say) 1 to 100, giving its height. Then, the hard part is generating a triangle strip across these values.......

    Google should help you if you search for things like this.

    Also, anything on www.gamedev.net might be useful.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Posts
    4
    Would a textured quad be good for a flat terrain ?

  4. #4
    Zaei
    Guest
    Depends on where you plan to go with it. Lighting and Fog look REALLY BAD when applied to a very large quad, and you dont get very much flexibility. A better way would be to create several quads, and map a texture over all of them.

    Z.

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    It's still best to decompose a single large object, since OpenGL only calculates lighting, etc., at the vertices, so the more vertices you have the closer you get to specular lighting (Phong shading, per-pixel shading, etc.) - there's a discussion on this at www.opengl.org.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

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



Click Here to Expand Forum to Full Width