Real-world heightmap... real world camera position

davesh

30-11-2006 01:08:25

My heightmap is derived from realworld terrain data; I know the latitude/longitude/altitude of the upper left corner of my map and of the lower right corner. As I move through the rendered scene, I want to be able to determine the real world location of the camera. Is there a way of querying the PLSM2 scene manager for the "current position relative to the upper left corner of the map"? I dont necessarily want to know what page or what tile i'm in (though perhaps I need to use these to determine the actual offset from the upper left corner). What I think I need is the "distance in ogre world coordinates from the upper left corner". If I know this distance then I should be able to apply a simple conversion to get a distance in the "real-world".

tuan kuranes

30-11-2006 08:57:04

you give the world height and widht in the config file, and can get them from getOption scenemanager mechanism...
As terrain is centered, position relative would be
x= myXpos - width/2
z= myZpos - height/2