diff --git a/engine/src/core/com/jme3/renderer/RenderManager.java b/engine/src/core/com/jme3/renderer/RenderManager.java index bee04ed59..152ce6ace 100644 --- a/engine/src/core/com/jme3/renderer/RenderManager.java +++ b/engine/src/core/com/jme3/renderer/RenderManager.java @@ -611,15 +611,19 @@ public class RenderManager { cam.clearViewportChanged(); prevCam = cam; - -// float translateX = viewWidth == viewX ? 0 : -(viewWidth + viewX) / (viewWidth - viewX); -// float translateY = viewHeight == viewY ? 0 : -(viewHeight + viewY) / (viewHeight - viewY); -// float scaleX = viewWidth == viewX ? 1f : 2f / (viewWidth - viewX); -// float scaleY = viewHeight == viewY ? 1f : 2f / (viewHeight - viewY); + float translateX = viewWidth == viewX ? 0 : -(viewWidth + viewX) / (viewWidth - viewX); + float translateY = viewHeight == viewY ? 0 : -(viewHeight + viewY) / (viewHeight - viewY); + float scaleX = viewWidth == viewX ? 1f : 2f / (viewWidth - viewX); + float scaleY = viewHeight == viewY ? 1f : 2f / (viewHeight - viewY); + orthoMatrix.loadIdentity(); - orthoMatrix.setTranslation(-1f, -1f, 0f); - orthoMatrix.setScale(2f / cam.getWidth(), 2f / cam.getHeight(), 0f); - System.out.println(orthoMatrix); + orthoMatrix.setTranslation(translateX, translateY, 0); + orthoMatrix.setScale(scaleX, scaleY, 1); + + //orthoMatrix.loadIdentity(); + //orthoMatrix.setTranslation(-1f, -1f, 0f); + //orthoMatrix.setScale(2f / cam.getWidth(), 2f / cam.getHeight(), 0f); + //System.out.println(orthoMatrix); } }