We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9a772e0 commit 3e70df9Copy full SHA for 3e70df9
libraries/vr/src/processing/vr/PGraphicsVR.java
@@ -62,9 +62,10 @@ protected PGL createPGL(PGraphicsOpenGL pg) {
62
@Override
63
public PMatrix3D getEyeMatrix() {
64
PMatrix3D mat = new PMatrix3D();
65
- mat.set(rightX, upX, forwardX, cameraX,
66
- rightY, upY, forwardY, cameraY,
67
- rightZ, upZ, forwardZ, cameraZ,
+ float sign = cameraUp ? +1 : -1;
+ mat.set(rightX, sign * upX, forwardX, cameraX,
+ rightY, sign * upY, forwardY, cameraY,
68
+ rightZ, sign * upZ, forwardZ, cameraZ,
69
0, 0, 0, 1);
70
return mat;
71
}
@@ -75,9 +76,10 @@ public PMatrix3D getEyeMatrix(PMatrix3D target) {
75
76
if (target == null) {
77
target = new PMatrix3D();
78
- target.set(rightX, upX, forwardX, cameraX,
79
80
+ target.set(rightX, sign * upX, forwardX, cameraX,
81
82
83
84
return target;
85
0 commit comments