Hello All,
I've just started to look at creating a simple shooter game using Xith. The main aim of this is to learn a bit about Xith while doing something (relatively) simple and fun.
What I had in mind was a simple top down shooter (2d world) using 3d models and effects. This way I get to play with Xith, while (hopefully) not having too much of a headache with the game.
I want to use a MVC style design where the rendering is handled by Xith and I have a simple data model running the game.
What I want to know is what is the best way of updating the scenegraph from the data model?
Do i have to run the model in the same thread as the scenegraph and do somthing like this (from Xith3DTextureBlendTest) where I tick the model, then update the scenegraph and then render it?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| while (true) { view.renderOnce();
try { Thread.sleep(10L); } catch (Exception e) { } angle += 0.005f; testRotateY.rotY(angle); testRotateYGroup.setTransform(testRotateY); } |
Or could I run the data model in a seperate thread and set up some kind of observer to update the scenegraph between renderings, so that the model can sync it's self to it's own timeing updates.
Sorry I've rambled a bit, I hope you can help point me in the right direction.
Dan.