Hallaw guys,

Do you know anything about how height mapping could be done ? By "height mapping", I mean going from this :

To this :

Do you guys can help me ?
I can't really help you myself, but since this was a project for Nspire using Ndless, I guess it is open-source so you may be able to have a glance at the code.
Well, right now I am looking at the source, but I'm that kind of person that needs proper explanations to achieve anything >_>
what exactly do you mean? storing values for height seems simple enough; have black be the minimum, white be the maximum, and everything else somewhere in between. if you mean making a 3d model from that, then it would just be a matter of drawing yourself some triangles from every adjacent group of four pixels, like so:

from that point on, it's just like drawing any other 3d model.
Yeah I know how to do a heightmap, but that's not it, what I don't know how to do is render the whole heightmap (1st image of my 1st post) into a whole pixel-based terrain (2nd image of my 1st post ; you can easily see that the pixels are not connected by triangles but by filtering/smoothing).
well, doesn't that just mean either making your height map higher resolution or adding in-between triangles with their angles extrapolated from the surrounding pixels? it's either that or making the whole thing voxel-based.
Basically, the pixels are grayscale, so each pixel has a value between 0 and 255 (or 2^bitdepth-1, anyway. GeoTIFF sometimes uses 16-bit layers, so 0 to 65535). Each pixel represents a rectangular (usually square) area of the map. You use each pixel value as a height, where 0 is usually the lowest and 255 is the highest, and generate terrain rectangles that each have that height at the center. Alternatively, you can use the pixel values for vertices of the terrain sheet.

Edit: If you use the height values for the vertices, then there's no smoothing involved.
KermMartian wrote:
and generate terrain rectangles that each have that height at the center.

That's all the problem >_> I know the basics of voxel-based landscape rendering (found the right term), but can't apply it. I need a proper tutorial to do so :/
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum