I run a Java programm, where I simulate assemblies of simple geometric objects, for example the generation of a tower of blocks or the assembly of a small pyramid.
Now I want to visualize what the simulation does.
In general this means that whenever the state of my simulation changes, the visualization is called and displays the new situation: New blocks have appeared or have changed positions. I do not need any animations, however to look at the scene from different perspectives would be a cool thing.
Is JMonkey the right tool to accomplish this, or is it to big for such a task?
And how would you do such a thing in JMonkey?
My general idea was to let the simulation call a method within the visualization to send the data to display. JME would then draw all the objects and wait for the next call. But how would I do that? This collides a little bit with the update loop, doesn’t it?
Thank you for giving me some opinions on which strategy I should follow,
I would do this in JMonkey yes… Mostly because it could easily accomplish every thing you wanted it to do, and i don’t know of any other way i would do it outside of jMonkey…
The easiest way i think would be to download the jme_3 SDK , and create a new project. Do the first few tutorials on basic shapes and translations and you will see that what you are asking it to do would be relatively straight forward. You may have to creatively include your existing code into the template application (“simpleAPP”) that JME provides you with, but depending on your java experience, that should be very straightforward as well.
If by “to big” you mean the learning curve would take to long i would fear not. from the moment i found the java monkey website, within a half an hour i had a project up and running and i was seeing blocks in my SimpleGame… the SDK makes the startup very easy…
Yes jME can absolutely do this.
With regards to colliding with the update loop, you can enqueue a Callable in the application which will be run during update.
Thank you! I will take a look if I can accomplish what I want with enqueue. Otherwise I think I have to rewrite my application so that the simulation is executed within the update loop. We’ll see