Is it possible to have both orthogonal and perspective views of the same scene simultaneously? If I call setParallelProjection(false) on a second camera, I lose the second view altogether.
[java]
public void simpleInitApp()
{
statsView.removeFromParent();
flyCam.setDragToRotate(true);
//flyCam.setMoveSpeed(10f);
cam.setParallelProjection(true);
float aspect = (float) cam.getWidth() / cam.getHeight();
float frustumSize = 1f;
cam.setFrustum(-1000, 1000, -aspect * frustumSize, aspect * frustumSize, frustumSize, -frustumSize);
rootNode.attachChild(SkyFactory.createSky(assetManager, "Textures/sky2.jpg", true));
Geometry teaGeom = (Geometry) assetManager.loadModel("Models/Teapot/Teapot.obj");
rootNode.attachChild(teaGeom);
DirectionalLight dl = new DirectionalLight();
dl.setColor(ColorRGBA.White);
dl.setDirection(Vector3f.UNIT_XYZ.negate());
rootNode.addLight(dl);
// set up second view
Camera cam2 = cam.clone();
cam2.setViewPort(0.6f, 0.99f, 0.05f, 0.45f);
cam2.setLocation(new Vector3f(0, 1, 10));
cam2.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);
cam2.setFrustumFar(250f);
//cam2.setParallelProjection(false);
ViewPort view2 = renderManager.createMainView("Inset view", cam2);
view2.attachScene(rootNode);
}
[/java]
The issue happens is because you’re converting a parallel projection camera (setup with setFrustum) to a perspective camera (setup with setFrustumPerspective). The values are incompatible with eachover. To fix the issue, call setFrustumPerspective on cam2