From: Symion <kn...@ip...> - 2009-12-04 03:34:52
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body bgcolor="#ffffff" text="#000000"> Hi there,<br> I have been trying to reset a scene to its original settings and I can not seem to be able to reset Userzoom input.<br> The following snippet demonstrates my problem.<br> If you run the code and spin the object around , then press any key! The program will close down the scene and restart with Exactly the same initial values.<br> So far so good!<br> Now zoom in or out and press any key!<br> The zoom factor is not removed from the new scene, and I can not seem to find any way to removing it!<br> Bearing in mind that turning Userzoom off is not an option, could you point me in the right direction?<br> Any help would be appreciated.<br> <br> '''Try to remove user zoom and spin components from scene<br> <br> Control:<br> Any key for next scene.<br> esc to quit.'''<br> <br> from visual import *<br> <br> print __doc__<br> i = 1<br> while 1:<br> scene.visible = False<br> scene.width, scene.height, scene.title = 600, 600, 'Demo%01i' %(i)<br> scene.forward = (0,0,-1) # Cancels previous Userspin component<br> scene.range = 1 # Does NOT cancel previous Userzoom component!<br> rate(2)<br> scene.visible = True<br> b = box()<br> while scene.kb.keys==0:<br> rate(50)<br> while scene.kb.keys>0:<br> kb = scene.kb.getkey()<br> b.visible = False<br> del b # Make sure object is Really gone<br> i+= 1<br> <br> <br> Symion </body> </html> |