Large Levels

Blitz3D Forums/Blitz3D Beginners Area/Large Levels

Well, you could try distance culling like you say, i.e. check the distance from camera to objects, and use HideEntity and ShowEntity. Note that trees that are behind the camera will not be rendered, so its pointless to check those.

Also, use types instead of arrays, as types are very fast to loop round. I use a type even if it is just storing the mesh (tree in your case).

e.g.

Type tree
   field mesh
End Type

tree_original = LoadMesh("tree.b3d")

for x = 1 to 10
   for z = 1 to 10
      newtree.tree = New tree
      newtree\mesh = CopyMesh(tree_original)
      y = 0 ;change this so it finds the height on the landscape at position x, z
      PositionEntity newtree\mesh, x, y, z
   next
next