我嘗試在我的GLSurfaceView上使用setRotation(),但視圖看起來不像圍繞屏幕中心的樞軸旋轉。如下面的代碼:如何旋轉GLSurfaceView?
class MyGLSurfaceView extends GLSurfaceView {
private float mCurRotation = 0.0f;
@Override
public boolean onTouchEvent(MotionEvent e) {
mCurRotation = mCurRotation + 10;
setRotation(mCurRotation);
}
}
是否有任何身體知道的原因,並教我如何旋轉我的GLSurfaceView?
讓我看看代碼;) –
嗨,gab,代碼已添加。 – leoncheng
這裏是如何使用OpenGL發佈的一個很好的答案:https://stackoverflow.com/questions/36703984/rotating-android-camera-preview-by-90-degrees-on-glsurfaceview-using-opengl-2 -0 –