How to find the Y coordinate for any X and Z of the vertex of the ground? At least the nearest vertex.
How about a delicious side of roasted playground, too?
https://www.babylonjs-playground.com/#1RKZXB#101
WASD-active. Line 29 updateMover()… does it all… including getHeightAtCoordinates().
Line 32 is a greasy wench, eh? It scared my dog. 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.
https://www.babylonjs-playground.com/#1RKZXB#102 tweaking needed.
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
Thx J!
Tighter/More-bullet-proof versions of that playground… welcome. (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)