Load 3D Model as terrain

I had seen terrain generated from JME code or using a "Heights Map".



But I guest use 3D Model as terrain will looks better.  Any example on use 3D Model as terrain?



Thanks

Splitting models is one thing, organizing them in a tree or matrix structure is another. If he does model splitting in the code then I guess it could work for you. But this is simple enough to do just by accessing TriMesh index and vertex buffers and doing the operations I said in my previous post.

Using 3D models for terrain doesn't give much benefit, other than being able to have overhangs on the terrain, but even then those can be accomplished for heightmapped terrains using some methods. Generally speaking, LOD algorithms, lightmap generation, painting, culling and hardware optimizations are more simpler and efficient to do for heightmapped terrains than for 3D terrains, so if you're aiming for modern hardware, heightmapped terrain would work better.

I guess the major drawback in jME in the case of terrain is the very limited support for all of those commonly used methods for heightmap terrain rendering.

Like me, you can simple load the model like any other model. To get the height I use something like (attention it shows the idea and NOT the code):

float getHeight(Vector3f position) {

  Ray r from position go down;

  return r.getFirstPick;

}



My problem at the moment is that one big model is very slow. I think you hae to split it in a few small models. But I can not tell you the way to do this automatically atm.

Here's an algorithm for splitting terrain meshes:

Create a matrix of bounding boxes, then check each triangle if it intersects/contained within the bounding box, if it is, then assign an ID to it (depending on the bounding box), if the triangle already has an ID, you skip it. The second pass goes through the triangles again and puts the triangles into meshes depending on their ID.

Momoko_Fan said:

Here's an algorithm for splitting terrain meshes:
Create a matrix of bounding boxes, then check each triangle if it intersects/contained within the bounding box, if it is, then assign an ID to it (depending on the bounding box), if the triangle already has an ID, you skip it. The second pass goes through the triangles again and puts the triangles into meshes depending on their ID.


would the octree code from lucas g accomplish this, seem like the same deal from the way u explain things

sorry for the hijack ://