mirror of
https://github.com/processing/processing4.git
synced 2026-02-10 17:19:25 +01:00
same changes related to #2259
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user