Hey I'm currently doing it for ROFH....
I was wondering can I getMesh("landmesh.obj");
and then somehow create an empty TerrainSceneNode and swap the contents and lengths of index and vertex buffers???
load a mesh from file then convert to terrain scene node??
The best way would be to cast rays against a triangle selector, use this to build the heightmap, then write it back out to disk. Once you've done this slow process once, you'll be able to load it back up again quickly next time round.
A terrain is a very restricted sort of mesh, so it will only work with very specific types of obj files. You'll lose UV mapping, vertices will be evenly spaced, everything will be welded together, you'll lose smoothing groups, multiple materials, it will only have one side and so on.
A terrain is a very restricted sort of mesh, so it will only work with very specific types of obj files. You'll lose UV mapping, vertices will be evenly spaced, everything will be welded together, you'll lose smoothing groups, multiple materials, it will only have one side and so on.
you can use oct tree scene node
Code: Select all
irr::scene::ISceneManager::addOctTreeSceneNode ( IAnimatedMesh * mesh,
ISceneNode * parent = 0,
s32 id = -1,
s32 minimalPolysPerNode = 512,
bool alsoAddIfMeshPointerZero = false
)
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
The terrain mesh is organized in a very specific way. The LoD algorithm (geomipmapping) relies on a specific width, height, plus the number of, position of and order of the vertices. It also only supports one mesh buffer. I'm not saying it's impossible, but it will be a pain to do with a mesh loaded from a mesh loader. You'd have to write the OBJ exporter so that the mesh is exactly what the terrain node expects, or rewrite it.devsh wrote:and is it the only way??? cant i just load the mesh as a normal mesh and swap its mesh buffers... or even vertex/index ones?