Thread: OpenGL Question

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    14

    OpenGL Question

    How do you create a terrain in opengl ?

  2. #2
    Veni Vidi Vice
    Join Date
    Aug 2001
    Posts
    343
    With all respect try the game forum.

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    411
    OpenGL is an API for drawing graphics to the screen. Those graphics are represented by the variables in code you have behind the scenes. So you have to mke the terrain in C / C++ coded, OpenGL just draws it.

  4. #4
    Registered User
    Join Date
    Jul 2002
    Posts
    14
    lol Eber i know what opengl is and know some of opengl code but i want to know the code for a simple flat terrain. Could i use a textured quad ?

  5. #5
    Registered User
    Join Date
    Aug 2001
    Posts
    411
    Quad or triangle , theres not a whole lot of choices, never use polygon in a serious project. And if you want wireframe terrain use a texture with a line around the edge, the glPolygonMode(GL_LINE) type thing is VERY slow.

    For my current terrain project I use two triangles in the form of a strip, and then use a linked list for a bucket sort to minimize calls to glBindTexture() (which is expensive as far as resources go).

    I am useing the Z axis as the terrain height, you can orient it any way you want, just so as you keep things uniform and keep in mind where the camera 'eye' is.

    For simple terrain you can create a 2d array that represents the terrain heights, then use a set of embedded for loops to draw each poly at connecting heights.
    Last edited by Eber Kain; 07-05-2002 at 07:49 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OpenGL Question
    By Halo3Master in forum Game Programming
    Replies: 16
    Last Post: 10-02-2007, 02:40 AM
  2. Opengl question
    By Shadowwoelf in forum Windows Programming
    Replies: 3
    Last Post: 06-03-2007, 01:21 PM
  3. OpenGL Camera Question
    By Astra in forum Game Programming
    Replies: 2
    Last Post: 03-25-2007, 01:53 PM
  4. OpenGL Question
    By Shamino in forum C++ Programming
    Replies: 5
    Last Post: 05-05-2005, 02:35 PM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM