Camera.setPosition

Started by AceGIS, September 18, 2012, 07:21:51 AM

Previous topic - Next topic

AceGIS

Hi,

How can I get the difference in z between the camera position and the terrain beneath the camera at its current position?

I want my camera position to always be at 2 units above the terrain.

Thanks in advance..

EgonOlsen

#1
It depends...you can use the methods for collision detection or calcMinDistance and adjust the height according to the result.

Edit: Depending on the complexity of the terrain, you might want to calculate an OcTree and enable use for collision detection (and disable use for rendering) on it.