Camera zoom and skybox

Working on my first jMonkey project. In short to solve the problem of zooming, in lieu of moving the camera itself, I am updating the bounding box through the setFrustum method. In doing so it makes the skybox appear as a small sphere in the middle of the world.

Screenshot

Relevant code

[java]
protected static float cameraZoom = 100f;

cam.setLocation(new Vector3f(0f, 200f, 0f));
cam.setParallelProjection(true);
aspect = (float) cam.getWidth() / cam.getHeight();
cam.setFrustum(-1000, 1000, -aspect * cameraZoom, aspect * cameraZoom, cameraZoom, -cameraZoom);

skyBox = SkyFactory.createSky(
assetManager, “Textures/Sky/Bright/BrightSky.dds”, false);
rootNode.attachChild(skyBox);

[/java]

I feel like zooming through this method is ideal for my requirements but am open to alternatives. I’m assuming there is a disconnect between the Frustrum update, parallel projection and skyBox but cannot determine where and how I can update it. Any help would be appreciated!

Why parallel projection? I think that is probably not what you really want.

At any rate, a sky box won’t work in parallel projection.

From all the samples I was finding for adjusting camera Frustum it seemed to required this mode. Without it the zooming doesn’t work right at all - ends up in tunnel vision etc… Any ideas for an alternative?

@methodin said: From all the samples I was finding for adjusting camera Frustum it seemed to required this mode. Without it the zooming doesn't work right at all - ends up in tunnel vision etc... Any ideas for an alternative?

I can’t see what you tried before but if you want a 3D scene then taking out the perspective is probably not what you want. And that’s what “parallel projection” does… takes perspective out completely. Far things never get any smaller. A 1 meter box is the same size up close as it is 1000 meters away. (Also, the skybox is a perspective effect so won’t work without it.)

What is the end result of what you want? A straight magnification? A change of FoV? Both?

Pretty much a straight magnification. Start out far away, camera rotating around in the sky (updating locations/rotation) and the ability to zoom in/out to the main terrain scene.

I didn’t think a straight camera movement would be what I wanted since I’m already updating the camera location in a loop - the camera is more or less on a fixed path. Perhaps another camera might be appropriate for this?

And after randomly trying a different method it seems to be working fine. Updated code:

[java]cam.setFrustumPerspective(cameraZoom, aspect, cam.getFrustumNear(), cam.getFrustumFar());[/java]

Luckily my zoom out doesn’t need to be too far so I don’t see the warp effect at larger angles.

Thanks for the help and making me look for alternatives. Sometimes knowing what NOT to do is extremely valuable.