TextureRenderer and a Sphere

Hi I would like to know if there is any good way to get a TextureRenderer to work with a sphere so it can have the reflection from everything around it.

I'm asking this because I'd like to modify the WaterRenderPass to work with water that use sphere as shape.



This is how far I've come:



         camLocation.set( cam.getLocation() );
         Vector3f globeCenter = theGlobe.getCenter();

         float planeDistance = com.jme.intersection.Distance.distance(globeCenter, camLocation ) - theGlobe.radius;      
            calcVect.set(globeCenter).multLocal( planeDistance * 2.0f );
         camReflectPos.set( camLocation.subtractLocal( calcVect ) );


         camLocation.set( cam.getLocation() ).addLocal( cam.getDirection() );
         planeDistance = com.jme.intersection.Distance.distance(globeCenter, camLocation ) - theGlobe.radius;
            calcVect.set(globeCenter).multLocal( planeDistance * 2.0f );
         camReflectDir.set( camLocation.subtractLocal( calcVect ) ).subtractLocal( camReflectPos ).normalizeLocal();

         camLocation.set( cam.getLocation() ).addLocal( cam.getUp() );
         planeDistance = com.jme.intersection.Distance.distance(globeCenter, camLocation ) - theGlobe.radius;
            calcVect.set(globeCenter).multLocal( planeDistance * 2.0f );
         camReflectUp.set( camLocation.subtractLocal( calcVect ) ).subtractLocal( camReflectPos ).normalizeLocal();

         //camReflectLeft.set( camReflectDir ).crossLocal( camReflectUp ).normalizeLocal();

         tRenderer.getCamera().getLocation().set( camReflectPos );
         tRenderer.getCamera().getDirection().set( camReflectDir );
         tRenderer.getCamera().getUp().set( camReflectUp );
         tRenderer.getCamera().getLeft().set( camReflectLeft );



tRenderer is a TextureRenderer in WaterRenderPass.
cam is the camera used by the WaterRenderPass.
theGlobe is the Sphere used by the modified version of WaterRenderPass.

The reflections are still all wrong and I thought you might be able to help me work this thing out.

//Considerate


Maybe you need to look at the testEnvMap??



that does a reflection off a torus, but I am not sure that is exactly what you want…