CPU intensive operations and jMonkeyEngine


I did search for information on this topic, but cannot seem to find a suitable solution.  I am using JME2 for this small project.

I have several boxes on the screen that need to move.  The coordinates for the boxes are determined by an external class, and I am using the SpatialTransform to translate the movement between the coordinates provided.

However, I have noticed that while the loop is running with updates being generated, the screen remains blank.  It is only when the loop has finished do I get the final position of all the boxes displayed on the screen.

Do I need to have a separate thread to update the display?  I am using SimpleGame at the moment, so will that mean that I need to go and use BaseGame?


depending on what you try to archive,

You can do the folowing stuff:

Update external thingy every x frames (will be a bit smoother)

Update external on request in jmonkey update method (unsmooth, but for example a setup scene and then click render would be suitable (like grafphs or other rarly changing)

Run it in a second thread,(very complicated, but should work smooth)

Sounds like you may have the movement loop in the simpleInit method rather than the simpleUpdate method you need to create.

Posting a small test case might help reveal the issue.


Thanks, I managed to resolve most of the problem.  I did not have the simpleUpdate method and now that I used it, it is automatically updating the display.  Everything was in simpleInit(), oops.  Another thing that I noticed is that with the simpleUpdate, I had to remove the loops that I had before as the code was being called automatically.

Thanks once again.