Sphere litten on the wrong side


I'm having a problem with a spotlight that lit a sphere on the opposite face, I hope it's nothing big, however, I don't really know what's wrong with my code:

my shpere is created this way (lambda is a dimensional constant, myDungeon is the main spatial Node attach to rootNode)

private void CreateSphere(){
      Sphere mySphere = new Sphere("sphere", new Vector3f(12*lambda, 4*lambda,24*lambda),3*lambda,3*lambda,5);
      MaterialState ms = display.getRenderer().createMaterialState();
        ms.setDiffuse(new ColorRGBA(1.0f, 1.0f, 1.0f, 1.0f));

my lights are like this

private void InitLights(){
      PointLight light = new PointLight();
      light.setLocation(new Vector3f(120.0f*lambda,100.0f*lambda,180.0f*lambda));
      lState = display.getRenderer().createLightState();

      lNode = new SimpleLightNode("light ceiling", light);
      lNode.setLocalTranslation(new Vector3f(12.0f*lambda,2.0f*lambda,18.0f*lambda));


and i call CreateSphere() before InitLights()

on the picture you can see the light source (point light) is in the right bottom corner, and the sphere is up left, and this is the upper left half of the sphere which is litten



Actually, that looks like there are 2 lights in the scene; your spot light and a directional light.  Make sure you do lightState.removeAll() before adding any new lights…

I’ve just tried to use this ‘removeAll()’ command, unfortunately, I cannot find it as a method of LightState http://www.jmonkeyengine.com/doc/com/jme/scene/state/LightState.html, the closest thing that appear to do that is ‘detachAll()’ which I’m already calling, or maybe I misunderstood

if you look at this second picture (light has been intensified), it’s like the light is not reflected correctly, what do you think?


i'm sure you tried lightstate.detachAll() already ?


even twice …

there's only one light in my code, plus the only red one is the point light, the wrong side of the sphere MUST be lighten by the point light, no? I mean it could be an option that I misconfigurated?

Ok I think I know where the problem comes from,

private void InitRenderers(){
      CullState cs = display.getRenderer().createCullState();


      ZBufferState zs = display.getRenderer().createZBufferState();


probably one of the two

I confirm, I forgot to activate the CullState, when using setEnabled(true), suddenly it works !!