Calculating the height of a landscape in 3d space

I'm diving into 3d programming a bit and am currently learning by writing a procedural terrain generator that generates terrain based on a heightmap. I would also like to implement some physics and my first terrain collision attempt was to just check the current position and heightmap. This, however, will not work well with small objects, as you will need to compute the height by taking the height of the difference between the closest vertices of the object and doing it rather slowly on each collision check.

Trust me I tried googling but there is just so much shit out there and millions of blogs posting downloaded beginner tutorials all over the place, mostly with no real information on the subject, I can't find anything that explains it, or even names at all methods used.

I am not asking for a code or a complete solution, but if anyone knows which method is appropriate for calculating a high resolution elevation map from an already generated and smoothed terrain, I would be very pleased as I could explore it further when I know that I'm looking for.

thanks

+2


a source to share


2 answers


What if you made your terrain a bunch of quads based on these elevation positions combined with their x / y positions. Now let's keep the normals for these squares. Now you are doing a simple, it is a point on this side of the polygon check that computes very quickly - the sign of the dot product between the normal surface and the point you are checking from. This is like culling the back surface, and most 3D systems will have routines to handle this for you.



+3


a source


I would highly recommend that you start with a 2m world map first, and then once you understand how heightmap works, program it in a 3D world.

This tutorial best describes what I mean. http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series1/Terrain_from_file.php



Have a look at Unity too: http://vimeo.com/73273585

0


a source







All Articles