jPCT-AE - a 3d engine for Android > Support

Camera.setPosition

(1/1)

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:
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.

Navigation

[0] Message Index

Go to full version