GeometryArray to use for landsape model

I am unsure of how the different GeometryArray-classes work when I manually want to generate a landscape from a set of 3D points.

I have an ordinary Point3f array that specify the coordinates in a square grid. Looks something like this:


myLandscapeCoords = new Point3f[] { (an array of x*x Point3f objects representing the points in the landscape grid...) }

The question is, how should they be ordered and which GeometryArray-calss (e.g., QuadArray) should be used? Currently I simply initialize them starting with the bottom left corner and go from left to right (i.e., one loop through z-axis with an inner loop through the x-axis).

I really need to find some good explaination of the different subclasses to GeometryArray…

all this is very well explained in sun’s tutorials, chapter 2: creating geometry.

PS: i wouldn’t take a QuadArray since 4 points of a landscape aren’t always coplanar! A TriangleArray or TriangleStripArray might be a better choice.

The September issue of JDJ will have an article that will help you do this. Look for it on the web (http://sys-con.com/java/) in a few days.

Thanks the tips. I had actually completly missed the Sun Java 3D tutorial. :slight_smile:

I’ve managed to get a landscape working partially using QuadArray, but switching to TriangleStripArray gave a much better result. The next step is to make it look like a “real” landscape.

I’m trying to implement a simple fractal landscape generator using the diamond-square algorithm. Since I’m doing a great deal of coding at work, my head tends to get a little heavy when I get home so my progress is a bit slow. When I’m done I’ll post here for those who are interrested…

I realize it’s not there yet but the same JDJ article will also include an explanation and code example for the diamond-square algorithm and vertex coloring.

Mike

[quote]The September issue of JDJ will have an article that will help you do this. Look for it on the web (http://sys-con.com/java/) in a few days.
[/quote]
Now online at: http://sys-con.com/story/?storyid=46231&DE=1. There are a few publishing issues being fixed yet today.