zoom out in OpenGL in android

前端 未结 3 1662
执笔经年
执笔经年 2021-02-09 21:47

I m using 3D object and rendering it and showing it by extends GLSurfaceView implementing Renderer, the problem is that how to do zoom out-in with pinch-in and pinch-out.

3条回答
  •  一生所求
    2021-02-09 22:13

    I would recommend looking at GLU.glLookAt() which allows you to set the eye and center point. You can then move your eye forward and back based on your zoom value.

    Alternatively you can use the android.openglMatrix class. And use perspectiveMatrix and lookAtMatrix functions then multiple those together and set them as your projectionMatrix.

提交回复
热议问题