How to get the coordinates of the vertex of the ground?

How to find the Y coordinate for any X and Z of the vertex of the ground? At least the nearest vertex.

1 Like

How about a delicious side of roasted playground, too?

WASD-active. Line 29 updateMover()… does it all… including getHeightAtCoordinates().

Line 32 is a greasy wench, eh? It scared my dog. :smiley: I wanted to avoid using parameters such as which, but my brain got in the way.

Also an issue when the center of the ground grid… is not the same position as a vertex. tweaking needed. :slight_smile:

Hey @jerome (or anyone else)… do you know a way to GET the subdivs of an already-created groundMesh? If I had that, I wouldn’t need to declare subdivs at line 16. Just curious… not necessarily suggesting the storage of that value.

Party on!

they exist and are hidden : Babylon.js/groundMesh.ts at master · BabylonJS/Babylon.js · GitHub


1 Like

Thx J!

Tighter/More-bullet-proof versions of that playground… welcome. :wink: (esp a version that eliminates which string.)

May I ask one more? Can a non-custom groundMesh EVER have differing x/z subdiv values?

Can you help me think of WHEN/HOW? (Part of bullet-proofing updateMover func) (thx for anything)