Help with textures

I have a node that has more than one spatial attached to it, the problem I'm having is how to get each spacial to have its own texture … I have one TextureState with 3 different texture units each holding a different texture, but when the node comes into view all spatial have the same texture … not the one they were assigned. I also build a quick and dirty 3ds model with a texture assigned to it in Anim8tor … even when the model is loaded the texture still is not the one I gave it … what am I doing wrong??

paste the code where you create or load the model and where you set the textures and texturestate.

dhdd said:

paste the code where you create or load the model and where you set the textures and texturestate.


crane = loader.load3ds("bin/models/crane.3ds","textures/building/crane.jpg" );
      
      ts = DisplaySystem.getDisplaySystem().getRenderer()
            .createTextureState();
      
      Texture craneTexture = TextureManager.loadTexture(BaseCity.class
            .getClassLoader().getResource("textures/buildings/crane.jpg"),
            Texture.MinificationFilter.Trilinear,
            Texture.MagnificationFilter.Bilinear);
      
      // place in the second unit.
      ts.setTexture(craneTexture, 2);
               
      crane.setRenderState(ts);

I solved it … I was forgetting to call setRenderState and updateRenderState after I rotate or Translate the node.





Thanks anyway !!!