Well its not to just put one item on the screen.
I need to load the 3d art using a list of stuff.
I needed to make a head LandscapeElement class for all the actual classes like trees and rocks etc. I made a LandscapeTools class to instantiate items, colorize them, combine the meshes of the parts that make a tree. Allowances for elements to centered on one of the 9 stud spaces, instead of just centered.
I made a new type of Space that can hold landscape items, SpaceLandscape. In the future I may do a Space3D for tunneling.
Then a LandscapeQuadTree class that holds a combined mesh of all the trees in a baseplate. Then limit how many vertexes can be in one mesh before a new set of quadtree children are created and those meshes combined, or destroyed when the number of elements decreases.
If each tree was its own mesh on the screen it would grind to a halt after about 1000 on my machine. Right now with 5x5 baseplates half full of tree stumps (several thousand treestumps) I'm at 2 million verts, 150 meshes @ 80 FPS, rather good I think.
If this was a static game environment it would have been much easier of course. In Unity we program in C#, which it pretty much the same as Java.
Last edited by Tzan
on Wed Apr 20, 2011 10:44 pm, edited 1 time in total.