controller = GameLogic.getCurrentController()
cam = controller.owner
camHeight = cam.worldPosition
Put that script on your camera, and camHeight will be the z-position of the camera.
If you want the angle to the other object, you could use some trigonometry. I’m not positive about this script, but it would be something like:
dx = abs(cam.worldPosition - trees.worldPosition)
dy = abs(cam.worldPosition - trees.worldPosition)
dz = abs(cam.worldPosition - trees.worldPosition)
hyp = sqrt(dx**2 + dy**2)
theta = atan(dz/hyp)
That leaves you with theta, which is the vertical angle from the trees to the camera, in radians. To convert to degrees, multiply theta by 180/pi.
If you have this script on the trees instead of the camera, remember that controller.owner will be the tree object, and you would need to get the camera from GameLogic.getCurrentScene().objects[“OBCamera”]
Then you can set theta*180/pi as the value of a property, and change the image using interval property sensors.