I have a couple more questions related to building a terrain Object3D.
My first question is why does building an Object3D increase its vertice count? Building the following square Object3D increases its vertice count from 4 to 12
Object3D terrain = new Object3D( 2 );
SimpleVector bottomLeft = new SimpleVector( 0, 0, 0 );
SimpleVector bottomRight = new SimpleVector( 5, 0, 0 );
SimpleVector topRight = new SimpleVector( 5, 0, 5 );
SimpleVector topLeft = new SimpleVector( 0, 0, 5 );
int triangle1 = terrain.addTriangle( topLeft, 0, 0,
bottomLeft, 0, 1,
bottomRight, 1, 1 );
int triangle2 = terrain.addTriangle( bottomRight, 1, 1,
topRight, 1, 0,
topLeft, 0, 0 );
System.out.println( "Unique Vertice count before build: " + terrain.getMesh().getUniqueVertexCount() );
System.out.println( " Triangles: " + terrain.getMesh().getTriangleCount() );
terrain.build();
System.out.println( "Unique Vertice count after build: " + terrain.getMesh().getUniqueVertexCount() );
System.out.println( " Triangles: " + terrain.getMesh().getTriangleCount() );
Strangely, the number of triangles remains 2 even though the number of vertices triples. What is causing this, and how do I prevent it from happening?
My second question is what is the best way to determine a polyID given a triangle number. I don't suppose they are the same, are they?
My last question is about OcTree's. The JavaDoc states that the best maxPoly value to use for an OcTree depends on the object and its usage. Unfortunately, I don't know enough to know what the best value to use for my situation might be. What would you recommend for terrain objects that are 32X32 grids with two triangles per square?