Thread: Terrain Generation / Displaying terrain

1. Terrain Generation / Displaying terrain

Well I've pretty much got this figured out now I think except in this tutorial I'm following the author leaves out a vital detail;
For the Triangle class, he leaves out the variable 'STEPS' (int triangleCount = (steps * steps * 2)
and this is for generating fractal terrain
Code :
```	private int[] i,j = new int[3];

public Triangle(int i0, int j0, int i1, int j1, int i2, int j2){
i[0] = i0;	i[1] = i1;	i[2] = i2;
j[0] = j0;	j[1] = j1;	j[2] = j2;
int triangleCount = (steps * steps * 2);
Triangle[] triangles = new Triangle[triangleCount];
int triangle = 0;
for (int i = 0; i < steps; i++){
for (int j = 0; j < steps; j++){
triangles[triangle++] = new Triangle (i, j, i + 1, j, i, j + 1);
triangles[triangle++] = new Triangle (i + 1, j, i + 1, j + 1, i, j + 1);
}
}
}```

Posting Permissions

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