• Advertisement

Archived

This topic is now archived and is closed to further replies.

Terrain rendering?

This topic is 5623 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do i render a terrain quick? Right now i do it like this:
procedure DrawTerrain();

procedure SetColor(Height: GLfloat);
var
  X : GLfloat;
begin
  X := 256/10/100*Height+0.2;
  glColor3f(X,X,X);
end;

var
  X : Integer;
  Z : Integer;
begin
  for X := 0 to MapSize-2 do
  begin
    glBegin(GL_TRIANGLE_STRIP);
    for Z := 0 to MapSize-1 do
    begin
        glTexCoord2f(X/MapSize,Z/MapSize);
        SetColor(HeightMap[ind(X,Z)]);
         glVertex3f(X, HeightMap[ind(X,Z)], Z);
        glTexCoord2f(X/MapSize+1.0/MapSize,Z/MapSize);
        SetColor(HeightMap[ind(X+1,Z)]);
         glVertex3f(X+1, HeightMap[ind(X+1,Z)], Z);
    end;
    glEnd();
  end;
end;
 
this works for small terrains, but i want a huge landscape. How do i solve this? [edited by - DanielH on September 30, 2002 9:22:53 AM]

Share this post


Link to post
Share on other sites
Advertisement
www.vterrain.org

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites

  • Advertisement