Jump to content

getHeightAtCoordinates not work with ImportMesh


Recommended Posts


I have a ground serialize with SerializeMesh() that I save in a babylon file. When I reload this file with ImportMesh:  getHeightAtCoordinates, updateCoordinateHeights, optimize ... does not work.  In fact everything concerning the ground create with CreateGroundFromHeightMap() or CreateGround() is serialized as mesh but can no longer be used as a terrain. We can only edit the properties on the mesh and not the geometry that no longer exists after serialization.

May be missing a serialization for the ground, like serialiserGround() in addition to serializeMesh(). Or convert a mesh to ground after using ImportMesh for used getHeightAtCoordinates

Thanks DK


Link to comment
Share on other sites

I think that a de-serialized mesh is just a mesh, not a groundMesh.

Maybe is there an elegant way in JS to give to the deserialized mesh all the groundMesh methods ?

something like :

deserializedGround.prototype = BABYLON.GroundMesh.prototype;

Dunno ...

Link to comment
Share on other sites

I think I understood nothing. When I do this, it does not work.

newMeshes[0].prototype = BABYLON.GroundMesh.prototype;


2 hours ago, Deltakosh said:

If someone wants to step in to add this option (should not be too difficult)

If Jerome says has no idea, I think it's difficult. I do not even know what file to edit and what to add.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...