@Override protected void initFrustumCam() { Camera viewCam = viewPort.getCamera(); frustumCam = viewCam.clone(); frustumCam.setFrustum(viewCam.getFrustumNear(), zFarOverride, viewCam.getFrustumLeft(), viewCam.getFrustumRight(), viewCam.getFrustumTop(), viewCam.getFrustumBottom()); }
@Override protected void initFrustumCam() { Camera viewCam = viewPort.getCamera(); frustumCam = viewCam.clone(); frustumCam.setFrustum(viewCam.getFrustumNear(), zFarOverride, viewCam.getFrustumLeft(), viewCam.getFrustumRight(), viewCam.getFrustumTop(), viewCam.getFrustumBottom()); }
public void postQueue(RenderQueue rq) { Camera sceneCam = rm.getCurrentCamera(); //update refraction cam refractionCam.setLocation(sceneCam.getLocation()); refractionCam.setRotation(sceneCam.getRotation()); refractionCam.setFrustum(sceneCam.getFrustumNear(), sceneCam.getFrustumFar(), sceneCam.getFrustumLeft(), sceneCam.getFrustumRight(), sceneCam.getFrustumTop(), sceneCam.getFrustumBottom()); refractionCam.setParallelProjection(sceneCam.isParallelProjection()); //update reflection cam WaterUtils.updateReflectionCam(reflectionCam, plane, sceneCam); //Rendering reflection and refraction rm.renderViewPort(reflectionView, savedTpf); rm.renderViewPort(refractionView, savedTpf); rm.getRenderer().setFrameBuffer(vp.getOutputFrameBuffer()); rm.setCamera(sceneCam, false); }
reflectionCam.setFrustum(sceneCam.getFrustumNear(), sceneCam.getFrustumFar(), sceneCam.getFrustumLeft(), sceneCam.getFrustumRight(), sceneCam.getFrustumTop(),
public OrganizedPointCloud getPointcloud() { float xyzrgb[] = new float[width * height * 4]; int ptr = 0; float n = offCamera.getFrustumNear(); float frustrumWidthToImageWidth = (offCamera.getFrustumRight() - offCamera.getFrustumLeft()) / width; float frustrumHeightToImageHeight = (offCamera.getFrustumTop() - offCamera.getFrustumBottom()) / height; for (int h = 0; h < height; h++) for (int w = 0; w < width; w++) { float x = 0, y = 0, z = 0; if (Float.isNaN(depthImage[h][w])) { z = Float.NaN;//Float.NaN; x = (float) ((w - width / 2) * frustrumWidthToImageWidth * z / n); y = (float) ((h - height / 2) * frustrumHeightToImageHeight * z / n); } else { z = depthImage[h][w]; x = (float) ((w - width / 2) * frustrumWidthToImageWidth * z / n); y = (float) ((h - height / 2) * frustrumHeightToImageHeight * z / n); } xyzrgb[ptr++] = x; xyzrgb[ptr++] = y; xyzrgb[ptr++] = z; xyzrgb[ptr++] = Float.intBitsToFloat(image.getRGB(w, h)); } return new OrganizedPointCloud(width, height, xyzrgb); }
public OrganizedPointCloud getPointcloud() { float xyzrgb[] = new float[width * height * 4]; int ptr = 0; float n = offCamera.getFrustumNear(); float frustrumWidthToImageWidth = (offCamera.getFrustumRight() - offCamera.getFrustumLeft()) / width; float frustrumHeightToImageHeight = (offCamera.getFrustumTop() - offCamera.getFrustumBottom()) / height; for (int h = 0; h < height; h++) for (int w = 0; w < width; w++) { float x = 0, y = 0, z = 0; if (Float.isNaN(depthImage[h][w])) { z = Float.NaN;//Float.NaN; x = (float) ((w - width / 2) * frustrumWidthToImageWidth * z / n); y = (float) ((h - height / 2) * frustrumHeightToImageHeight * z / n); } else { z = depthImage[h][w]; x = (float) ((w - width / 2) * frustrumWidthToImageWidth * z / n); y = (float) ((h - height / 2) * frustrumHeightToImageHeight * z / n); } xyzrgb[ptr++] = x; xyzrgb[ptr++] = y; xyzrgb[ptr++] = z; xyzrgb[ptr++] = Float.intBitsToFloat(image.getRGB(w, h)); } return new OrganizedPointCloud(width, height, xyzrgb); }
float m00 = (viewport.getCamera().getFrustumRight() - viewport.getCamera().getFrustumLeft()) / (2f * viewport.getCamera().getFrustumNear()); float m11 = (viewport.getCamera().getFrustumTop() - viewport.getCamera().getFrustumBottom()) / (2f * viewport.getCamera().getFrustumNear());
@Override protected void initFrustumCam() { Camera viewCam = viewPort.getCamera(); frustumCam = viewCam.clone(); frustumCam.setFrustum(viewCam.getFrustumNear(), zFarOverride, viewCam.getFrustumLeft(), viewCam.getFrustumRight(), viewCam.getFrustumTop(), viewCam.getFrustumBottom()); }
@Override protected void initFrustumCam() { Camera viewCam = viewPort.getCamera(); frustumCam = viewCam.clone(); frustumCam.setFrustum(viewCam.getFrustumNear(), zFarOverride, viewCam.getFrustumLeft(), viewCam.getFrustumRight(), viewCam.getFrustumTop(), viewCam.getFrustumBottom()); }
Math.abs(viewport.getCamera().getFrustumLeft() + viewport.getCamera().getFrustumRight()) > 1e-7)
public void cameraRestore() { Camera cam = app.getCamera(); //cam.setAxes(storedCamera.getLeft(), storedCamera.getUp(), storedCamera.getDirection()); //cam.setRotation(storedCamera.getRotation()); cam.setFrame(storedCamera.getLocation(), storedCamera.getRotation()); cam.setFrustum(storedCamera.getFrustumNear(), storedCamera.getFrustumFar(), storedCamera.getFrustumLeft(), storedCamera.getFrustumRight(), storedCamera.getFrustumTop(), storedCamera.getFrustumBottom()); //cam.setLocation(storedCamera.getLocation()); }
public void postQueue(RenderQueue rq) { Camera sceneCam = rm.getCurrentCamera(); //update refraction cam refractionCam.setLocation(sceneCam.getLocation()); refractionCam.setRotation(sceneCam.getRotation()); refractionCam.setFrustum(sceneCam.getFrustumNear(), sceneCam.getFrustumFar(), sceneCam.getFrustumLeft(), sceneCam.getFrustumRight(), sceneCam.getFrustumTop(), sceneCam.getFrustumBottom()); refractionCam.setParallelProjection(sceneCam.isParallelProjection()); //update reflection cam WaterUtils.updateReflectionCam(reflectionCam, plane, sceneCam); //Rendering reflection and refraction rm.renderViewPort(reflectionView, savedTpf); rm.renderViewPort(refractionView, savedTpf); rm.getRenderer().setFrameBuffer(vp.getOutputFrameBuffer()); rm.setCamera(sceneCam, false); }
public void postQueue(RenderQueue rq) { Camera sceneCam = rm.getCurrentCamera(); //update refraction cam refractionCam.setLocation(sceneCam.getLocation()); refractionCam.setRotation(sceneCam.getRotation()); refractionCam.setFrustum(sceneCam.getFrustumNear(), sceneCam.getFrustumFar(), sceneCam.getFrustumLeft(), sceneCam.getFrustumRight(), sceneCam.getFrustumTop(), sceneCam.getFrustumBottom()); refractionCam.setParallelProjection(sceneCam.isParallelProjection()); //update reflection cam WaterUtils.updateReflectionCam(reflectionCam, plane, sceneCam); //Rendering reflection and refraction rm.renderViewPort(reflectionView, savedTpf); rm.renderViewPort(refractionView, savedTpf); rm.getRenderer().setFrameBuffer(vp.getOutputFrameBuffer()); rm.setCamera(sceneCam, false); }
reflectionCam.setFrustum(sceneCam.getFrustumNear(), sceneCam.getFrustumFar(), sceneCam.getFrustumLeft(), sceneCam.getFrustumRight(), sceneCam.getFrustumTop(),
reflectionCam.setFrustum(sceneCam.getFrustumNear(), sceneCam.getFrustumFar(), sceneCam.getFrustumLeft(), sceneCam.getFrustumRight(), sceneCam.getFrustumTop(),
refractionCam.setFrustum(sceneCam.getFrustumNear(), sceneCam.getFrustumFar(), sceneCam.getFrustumLeft(), sceneCam.getFrustumRight(), sceneCam.getFrustumTop(), reflectionCam.setFrustum(sceneCam.getFrustumNear(), sceneCam.getFrustumFar(), sceneCam.getFrustumLeft(), sceneCam.getFrustumRight(), sceneCam.getFrustumTop(),
reflectionCam.setFrustum(sceneCam.getFrustumNear(), sceneCam.getFrustumFar(), sceneCam.getFrustumLeft(), sceneCam.getFrustumRight(), sceneCam.getFrustumTop(),