Skip to content

Redraws Cannot Be Synchronized #4

@ShadSterling

Description

@ShadSterling

Originally reported in the Tracker on the SourceForge project, 2000-Dec.-27, http://bit.ly/SZfe3U

Without synchronizing redraws, the user will see partially updated scenes, likely in an incoherent state.
This makes vpython unusable for animated scenes with nontrivial computation per frame, which includes everything I intended to use it for.

I would like to be able to do something like this:

scene.autoredraw = false # disable unsynchronized redraws
while myUpdate( scene ):
    scene.redraw( minInterval ) # synchronized redraw between updates

The original reporter suggested this:

while 1:
    visual.stop() # suspend the visualization thread
    doMyCalculations()
    visual.start() # resume the visualization thread
    visual.rate(30)

For one easy to see example of the problem:
Run my code at http://pastebin.com/srsZLKWR and make it continuously advance (by clicking on a blue arrow, dragging the mouse, and then holding the button down).
On my computer you can see the particles update before the field arrows, and you can watch the updating of the field arrows propagate through the field.
I can't tell how much time is spent updating the scene and how much time is spent drawing intermediate states that are not intended to be seen, but I expect eliminating the unnecessary redraws would improve performance as well as prevent drawing incoherent states.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions