PDA

View Full Version : Heightmaps - - adding new features



cutting_crew
12-05-2003, 10: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!

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

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

-Ilkka

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

sebh
12-05-2003, 02: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).]