I have a program that parses an OpenFlight file and is now loading it into JME. It works great except for one piece. The model is a police car with sirens on top. In order to get the sirens to appear as if they are working, it use two diffrent images for texture, One with the lights on and one with the lights off. I load all the textures for the car but only the lights on texture appears. The textures have the same coordinates so I need to switch the textures out as it calls update.
Any ideas on who to continually switch the textures?
Sounds like a controller job. Write yourself a controller which will swap texture states for you.
I have very limited knowledge.
But as he said wuoldnt you just go:
Load texture 1 into texture state.
Load texture 2 into texture state.
Main game loop - or somewhere, make a call to a function which will switch from one to another every half a second say and boom, thats you got youre flashing light?
Exactly. There may be other ways people have done it, I don't know them though.
maybe it already has a controller for the animation - if so
policeCar.getController(0).setActive(true);
may work....
theprism said:
maybe it already has a controller for the animation - if so
policeCar.getController(0).setActive(true);
may work....
[shameless plug] You could easily use Scene Monitor to check for controllers and test them. ;)[/plug]