* resize affordance
*/
private Node createSphereNode(String name) {
// Create the new node and sphere primitive
Node sphereNode = new Node();
Sphere sphere = new Sphere(name, 30, 30, radius);
sphereNode.attachChild(sphere);
// Set the color to black and the transparency
RenderManager rm = ClientContextJME.getWorldManager().getRenderManager();
sphere.setSolidColor(new ColorRGBA(0.0f, 0.0f, 0.0f, 0.5f));
sphereNode.setRenderState(zbuf);
MaterialState matState = (MaterialState)rm.createRendererState(StateType.Material);
sphereNode.setRenderState(matState);
matState.setDiffuse(new ColorRGBA(0.0f, 0.0f, 0.0f, 0.5f));
matState.setAmbient(new ColorRGBA(0.0f, 0.0f, 0.0f, 0.5f));
matState.setShininess(128.0f);
matState.setEmissive(new ColorRGBA(0.0f, 0.0f, 0.0f, 0.5f));
matState.setEnabled(true);
BlendState alphaState = (BlendState)rm.createRendererState(StateType.Blend);
alphaState.setBlendEnabled(true);
alphaState.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
alphaState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
alphaState.setTestEnabled(true);
alphaState.setTestFunction(BlendState.TestFunction.GreaterThan);
alphaState.setEnabled(true);
sphere.setRenderState(alphaState);
// Remove the back faces of the object so transparency works properly
CullState cullState = (CullState)rm.createRendererState(StateType.Cull);
cullState.setCullFace(CullState.Face.Back);
sphereNode.setRenderState(cullState);
// Set the bound so this node can be pickable
sphere.setModelBound(new BoundingSphere());
sphere.updateModelBound();
return sphereNode;
}