tags:

views:

55

answers:

1

Hi! Using the Ogre3D engine (C++), I would like to generate a mesh from a grayscale heightmap. I know that the Terrain tools can do that but I just want a simple mesh. What would be the best way to do that? This sounds pretty basic but I can't find my way in the Ogre3d doc.

Thanks!

+1  A: 

One way to do it is extract all the height values and pump them into an Ogre::ManualObject.

Then call ManualObject::convertToMesh(...) for the conversion.

Fire up a MeshSerializer and use it to save the mesh out to a file.

MeshPtr pmo = mo.convertToMesh( "GrassBladesMesh" );
MeshSerializer ser;
ser.exportMesh( pmo.getPointer(), "grass.mesh" );

See Ogre::ManualObject link above for more info. HTH

JustBoo
Thanks, this ManualObject looks very handy, I'll give it a shot!
Jim