I was wondering if there is another (fast) way of knowing on wich tile of a terrain i click with the mouse.
The problem is this, i have a Heightmap file from a game wich is let's say 200x150 i convert it to vertices and it shows fine in GL only i need to move/rotate it around, after all those operations i will have to calculate the original heightmap coordinate, i did manage to do this by using selection in GL but it's too slow on a 500 MHZ machine with an MX440 card, selection requires drawing one frame in selection mode and i have to assign some names(numbers) to every tile wich takes time and selection is not fast enough. I tried gluUnProject(wich is verry fast) but it gives me wrong coordinates, do you know how to obtain at least the initial tile coordinates i pass to GL ? I can calculate the exact tile in the heightmap.
You may wonder why do i need this, well it's for a terrain editor wich i made some time ago but it's too slow and working with it would be quite annoying, gluUnProject would be nice but it gives me the current coordinate and i need to know the exact tile/vertex i'm clicking on to be able to modify the terrain.
It would also be nice if i could know wich tile without drawing all tiles if the camera is not verry close and the user probably doesn't need exact coordinate.
Bookmarks