我想知道在使用透視投影時是否有簡單的方法來翻轉y座標?關於這個問題的線索似乎集中在正交投影上。我正在將基於Canvas的遊戲轉換爲OpenGL ES 2.0,並且具有相對複雜的碰撞檢測功能。和大量的語法是基於y軸從屏幕的頂部始於0和例如2560OpenGL ES 2.0:使用透視投影翻轉y座標
@Override
public void onSurfaceChanged(GL10 unused, int width, int height) {
game_width = width;
game_height = height;
GLES20.glViewport(0, 0, width, height);
// while the width will vary as per aspect ratio.
final float ratio = (float) width/height;
final float left = -ratio;
final float right = ratio;
final float bottom = -1.0f;
final float top = 1.0f;
final float near = 1f;
final float far = 40.0f;
Matrix.frustumM(mProjectionMatrix, 0, left, right, bottom, top, near, far);
}
感謝您的長期和不錯的答案 - 將更多地考慮這一點,並在適當的時候接受它 – java