Hi I was wondering if there is any chance you can make water shaped like a sphere with working reflection and such.
Node reflectedNode = new Node( "reflectNode" );
reflectedNode.attachChild( skybox );
reflectedNode.attachChild( createObjects() );
java.util.ArrayList<com.jme.scene.Spatial> rootChildren = rootNode.getChildren();
for(int i = 0; i < rootChildren.size(); i++)
{
reflectedNode.attachChild(rootChildren.get(i));
}
reflectedNode.attachChild((com.jme.scene.Spatial)page);
rootNode.attachChild( reflectedNode );
waterEffectRenderPass = new WaterRenderPass( cam, 4, false, true );
//setting to default value just to show
waterEffectRenderPass.setWaterPlane( new Plane( new Vector3f( 0.0f, 1.0f, 0.0f ), 0.0f ) );
Sphere waterSphere = new Sphere("waterSphere", new Vector3f(),400,400,500f);
waterEffectRenderPass.setWaterEffectOnSpatial((com.jme.scene.Spatial) waterSphere );
rootNode.attachChild( waterSphere);
createDebugQuads();
rootNode.attachChild( debugQuadsNode );
waterEffectRenderPass.setReflectedScene( reflectedNode );
waterEffectRenderPass.setSkybox( skybox );
pManager.add( waterEffectRenderPass );
This makes a sphere but the reflection is all wrong, so is the function to see if you're below or above the water.
Could you possibly have a workaround for this, I like the water but I'd really like my planet to be a planet and not a flat plane.
Thank you, Considerate.