Catalog · How the catalog works
3D-Terrain-Programming
A serie of examples increasing the complexity example-by-example. (WIP)
- ★ 1 on GitHub
Anyone may press Interesting, signed in or not. It helps others find this project.
README
3D Terrain Programming
A serie of examples increasing the complexity example-by-example.
Based on Focus on 3D Terrain Rendering by Trent Polack.
1-Basic brute force
In: Delphi(GLScene)

Load a bitmap and render a very plain 3D Terrain without any optimization.
var
z, x: integer;
h: byte;
y: single;
//***
for z := 0 to FHeightField.DimensionLength - 2 do
begin
glBegin(GL_TRIANGLE_STRIP);
for x := 0 to FHeightField.DimensionLength - 1 do
begin
h := FHeightField.GetValue(x, z);
y := h * SCALE;
glColor3ub(h, h, h);
glVertex3f(x, y, z);
h := FHeightField.GetValue(x, z + 1);
y := h * SCALE;
glColor3ub(h, h, h);
glVertex3f(x, y, z + 1);
end;
glEnd;
end;
