View Full Version : Heightmaps - - adding new features

12-05-2003, 09:13 AM
my heightmap is looking goood:

i have a nice color scheme going but heres 2 things that i would like to implement:

1: A Picking Function -- this picking function will display a height value right by the mouse pointer if i click on any part of the heightmap. so if your mouse is covering the heightmap at any point(vertex point check?) it willreturn and show on screen the height value associated with where the mouse is pointing. i already have a 2D print function so thats not the problem, i need to be able to print the height where i click but not just anywhere on the screen but down at where i am pointing if that makes sense..so i guess i am wondering how i will go about doing this.

2: i want to add contours to the heightmap. not just "fake" contours.. but adding lets say circle contours for high points of the heightmap(mountains) etc etc. does anyone have any links or help that you can give me? thanks in advance!

12-05-2003, 09:46 AM
For #2, I'd just use a fragment program that computes the height for the fragment and computes a color accordingly.

12-05-2003, 11:33 AM
A fragment program? Are you crazy? How about a 1d texture, just set (or generate) texture coordinates based on height.


12-05-2003, 01:18 PM
Yeah, that'll work too http://www.opengl.org/discussion_boards/ubb/wink.gif

12-05-2003, 01:28 PM
You can also render filled front face with texture and then black back face in wireFrame with size of 10, for example, to render the silhouette.
It's a 2 pass algorithm.

[This message has been edited by sebh (edited 12-05-2003).]