same changes related to #2259

This commit is contained in:
codeanticode
2014-01-05 13:38:24 -05:00
parent 8981790c21
commit 4331296e1d
3 changed files with 24 additions and 26 deletions

View File

@@ -87,7 +87,20 @@ public class PGraphics3D extends PGraphicsOpenGL {
pushProjection();
ortho(0, width, 0, height, -1, +1);
pushMatrix();
camera(width/2, height/2);
// Set camera for 2D rendering, it simply centers at (width/2, height/2)
float centerX = width/2;
float centerY = height/2;
modelview.reset();
modelview.translate(-centerX, -centerY);
modelviewInv.set(modelview);
modelviewInv.invert();
camera.set(modelview);
cameraInv.set(modelviewInv);
updateProjmodelview();
}