Search code examples
androidopengl-esandroid-graphics

Android graphics.Camera - how to set Location perpendicular to surface?


android's class import android.graphics.Camera has a default location it uses. but there is a method to change the camera's position.

How can i adjust the camera's tilt such that it looks at the view perpendicular to the surface. sort of like looking from a air-plane onto the surface ?

Here is what i have attempted so far:

mCamera.setLocation(0f,9f,0f)

but this does not make the viewing angle perpendicular to the ground.


Solution

  • You'll need to rotate the camera, I don't know this API but it seems that you have rotate methods available.

    I'd try a mCamera.rotateX(90) for a start.