Hey all, I want to do some simulation on meshes using OpenFlipper. Now I encounter a problem. In the simulation, I want to update the scene every step. The pseudo code like /******** func() { ... Loop: do something about the mesh (object); updatedObject(); updateView(); EndLoop } ********/ But actually it only shows the final view of the object for the whole process. I want to view the whole process of the simulation. How can I do with that? Would you please give me some advices? Thanks -- Best regards, Bo Wu
On 19.12.2012 01:37, Bo Wu wrote:
Hey all,
I want to do some simulation on meshes using OpenFlipper. Now I encounter a problem. In the simulation, I want to update the scene every step. The pseudo code like
/******** func() { ... Loop: do something about the mesh (object); updatedObject(); updateView(); EndLoop } ********/
But actually it only shows the final view of the object for the whole process. I want to view the whole process of the simulation. How can I do with that? Would you please give me some advices?
Thanks
-- Best regards, Bo Wu
Hi, i guess your loop is in one function inside your plugin. The problem is, that you never return control to the Qt Mainloop where the view updates are executed, as you stay in your loop. The easiest way would be to create a QTimer in your plugin, that fires at your desired frame rate and calls a function, only containing the internal part of the loop. That way, the core will have the chance to update the scene in between. BTW, you can omit the updateView call. updatedObject already takes care about the view update. Best, Jan Möbius -- Dipl.Inform. Jan Möbius Department of Computer Science VIII Aachen University of Technology (RWTH) Ahornstrasse 55, 52074 Aachen, Germany Phone ++49 (0)241 80-21817 Fax ++49 (0)241 80-22899 mailto:moebius@cs.rwth-aachen.de http://www.rwth-graphics.de
Hi Jan, That is exactly my problem and your advice shoots the problem. I have tried QTimer and it works very well. Danke schön 2012/12/19 Jan Möbius <moebius@cs.rwth-aachen.de>
On 19.12.2012 01:37, Bo Wu wrote:
Hey all,
I want to do some simulation on meshes using OpenFlipper. Now I encounter a problem. In the simulation, I want to update the scene every step. The pseudo code like
/******** func() { ... Loop: do something about the mesh (object); updatedObject(); updateView(); EndLoop } ********/
But actually it only shows the final view of the object for the whole process. I want to view the whole process of the simulation. How can I do with that? Would you please give me some advices?
Thanks
-- Best regards, Bo Wu
Hi,
i guess your loop is in one function inside your plugin.
The problem is, that you never return control to the Qt Mainloop where the view updates are executed, as you stay in your loop.
The easiest way would be to create a QTimer in your plugin, that fires at your desired frame rate and calls a function, only containing the internal part of the loop. That way, the core will have the chance to update the scene in between.
BTW, you can omit the updateView call. updatedObject already takes care about the view update.
Best, Jan Möbius
-- Dipl.Inform. Jan Möbius Department of Computer Science VIII Aachen University of Technology (RWTH) Ahornstrasse 55, 52074 Aachen, Germany
Phone ++49 (0)241 80-21817 Fax ++49 (0)241 80-22899 mailto:moebius@cs.rwth-aachen.de http://www.rwth-graphics.de _______________________________________________ Openflipper mailing list Openflipper@lists.rwth-aachen.de http://mailman.rwth-aachen.de/mailman/listinfo/openflipper
-- Best regards, Bo Wu
participants (2)
-
Bo Wu
-
Jan Möbius