Texture is wrong reused from other spatial

Hi all,

i work on a little Robotsimulation and got now some problems with applying texture on the floor of the simulation.

some older Code can be viewed in the physics forum (http://www.jmonkeyengine.com/forum/index.php?topic=12166.0).

(there is also a wiki page for the robot, if someown has interessed to see what is needed to create this robot: http://www.jmonkeyengine.com/wiki/doku.php/starter:move_a_robot_with_jme2physics)

i search on the web and on the jme forums for some solutions but couldn

Hi all,

i made a simple test project just using jme code.

I checks what happen if i uses two textures which are both in jme.

one i add to the floor and the other to the boxes which were created if the key 5 is pressed.

the problem is now that only the texture is used that was conected with the floor, and this texture is applyed also for the boxes and that one which should be used is ignored   :?

it would be great if some own know why this behavour is shown and post the answer.



i make a strang observation, if i press the letter "l" (L) the light is turned on and in the TestProject the Boxes get the correct texture immediately.

In the original project the robot becomes white after pressing one time (l) and after pressing the key again its correct color, like the robot would be loaded the first time.

regards cupido

the solution was "just" to call  


after the spatial (or rather the dynamicPhysicNode which contains the spatial) was added to rootNode.
so all spatial uses their correct texture or rather their colors.

But in the Robotsimulation there is still the effect that the robot is white if the light is turned on. Turning the light off robot is shown again correct in blue.  

maybe i will post the last solution soon :)

greets cupido

updateRenderState() is always needed if something new is attached to the scene graph, its a common ptifall :slight_smile:

I'm not sure what could be wrong with the second issue you mentioned.

Usually no light means white objects (only vertex colors are shown), light will show light+material colors.