From: Jerzy K. <jer...@un...> - 2012-05-22 09:00:37
|
Bruce Sherwood : > I too thought of a way to introduce a callback, by using threads (this > is based on the scheme used in the graphing module, vis/graph.py, to > enable the feature that dragging the mouse shows crosshairs on a > graph). > > from visual import * > ... > while True: > rate(100) > if run: b.rotate(angle=.01, axis=(0,1,0)) This is nice and may be very useful; in general I think that VP is underused in the domain of simulation (+visu+measuring, for pedagogical purposes) despite quite a number of applications. But you might remember our short discussion some months ago. I discovered that rate() doesn't work well with threads in general. This directive introduces a time-consumming loop. The event processing with timers should be low-level (in my understanding of this stuff). The best. Jerzy Karczmarczuk |