mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
corrected centering in ortho
This commit is contained in:
@@ -3697,15 +3697,18 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
// Flushing geometry with a different perspective configuration.
|
||||
flush();
|
||||
|
||||
left -= width/2;
|
||||
right -= width/2;
|
||||
float halfw = 0.5f * (right - left);
|
||||
float halfh = 0.5f * (top - bottom);
|
||||
|
||||
bottom -= height/2;
|
||||
top -= height/2;
|
||||
|
||||
near += cameraDepth;
|
||||
far += cameraDepth;
|
||||
left -= halfw;
|
||||
right -= halfw;
|
||||
|
||||
bottom -= halfh;
|
||||
top -= halfh;
|
||||
|
||||
// near += cameraDepth;
|
||||
// far += cameraDepth;
|
||||
|
||||
float x = 2.0f / (right - left);
|
||||
float y = 2.0f / (top - bottom);
|
||||
float z = -2.0f / (far - near);
|
||||
|
||||
Reference in New Issue
Block a user