• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

3D Terrain get Z

V

Vikom

Guest
Hi!
I'm trying to make work a 3d terrain.
(I admit I was using 2d arrays until yesterday, then I've discovered ds_grid. Off topic ends now!)

Simply, I have no problem making 3d terrain using primitives, I even managed to get it from heightmap but I struggle at getting the Z coordinate.

Getting just the Z from the nearest coordinate is not smooth. Trying to solve it with very tiny triangles is a bad idea and it fries the GPU.

I came up with an idea to get the Z according to the Zs from the current triangle's 3 corners and by the distance to them. By misusing my mathematican friends, I would probably manage to get it work but it still doesn't sound like the best way to do it.

Please, what is the best way to get the Z from the 3d terrain?
 
Top