@Override
    public void simpleInitApp() {
        cam.setLocation(new Vector3f(3, 3, 3));
        cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);
 
        Texture offTex = setupOffscreenView();
        Spatial sky = SkyFactory.createSky(assetManager, offTex, 
                EnvMapType.CubeMap);
        rootNode.attachChild(sky);
    }
Renders a rotating box to a cubemap texture, then applies the cubemap
texture as a sky.
jme3-examples/src/main/java/jme3test/post/TestRenderToCubemap.java