Skip to content

Commit 9f52da2

Browse files
Romain GuyAndroid (Google) Code Review
authored andcommitted
Merge "Fix android.opengl.Matrix frustum's generation" into jb-mr1-dev
2 parents e23ae14 + 0a088f5 commit 9f52da2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

opengl/java/android/opengl/Matrix.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ public static void orthoM(float[] m, int mOffset,
312312
* @param near
313313
* @param far
314314
*/
315-
316315
public static void frustumM(float[] m, int offset,
317316
float left, float right, float bottom, float top,
318317
float near, float far) {
@@ -336,10 +335,10 @@ public static void frustumM(float[] m, int offset,
336335
final float r_depth = 1.0f / (near - far);
337336
final float x = 2.0f * (near * r_width);
338337
final float y = 2.0f * (near * r_height);
339-
final float A = 2.0f * ((right + left) * r_width);
338+
final float A = (right + left) * r_width;
340339
final float B = (top + bottom) * r_height;
341-
final float C = (far + near) * r_depth;
342-
final float D = 2.0f * (far * near * r_depth);
340+
final float C = -(far + near) * r_depth;
341+
final float D = -2.0f * (far * near * r_depth);
343342
m[offset + 0] = x;
344343
m[offset + 5] = y;
345344
m[offset + 8] = A;

0 commit comments

Comments
 (0)