Jump to content

getHeightAtCoordinates return wrong value


Recommended Posts

Hello !

I found that the getHeightAtCoordinates function of GroundMesh return wrong value when the ground position has been changed.

Here is a playground to illustrate what I'm saying. http://www.babylonjs.com/playground/#RVTBV#4


In the playground the position of the mesh is set to (2, 2, 0) but the function return 4 (it should return 2).

We could also consider that the value to return must be in the local space of the ground but even if it is the case, the value should be 0, and not 4.


So I modified the function and it returns now the good value.


* You can as you want change the ground position with variable groundPosition

You can also easily change the x and z coordinates of intersection with the variable coord


Is there something wrong in the way I use the function or is it a bug ?


PS: return values are displayed in the console

Edited by kostar111
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...