I want to convert a mesh to terrain. Which is partly done, but not completely because updateCoordinateHeights() and getHeightAtCoordinates(0, 0) don’t work.
I used bakeCurrentTransformIntoVertices() to transform a plane into a terrain, but I think something is still missing.
Hmm I’ve never tried converting an object of type Mesh to an object of type GroundMesh and the only way I can think of is pretty hacky, e.g. assigning the missing functions from the GroundMesh prototype to the mesh and adding the missing properties as well. Maybe someone else will have a cleaner way but in theory it should work I think, although for an imported mesh I guess would need to iterate over the vertex positions to get the mins and maxes and size which here are already known…
It seems to work that way. Thanks for this solution.
If anyone has another less hacky solution. thank you for letting it know. It would be nice if this was possible in the engine because a GroundMesh terrain is flat and using modeling software to create the terrain allows more, but it’s a Mesh not a GroundMesh.
Thank you Blake for your solution which I hope will be temporary.