From: Bruce S. <bas...@un...> - 2002-06-05 14:23:51
|
At 09:53 PM 6/4/2002 -0400, Jon Schull wrote: >How might I programatically get a scene to continuously rotate (presumably >after setting userspin to 0)? There are two answers to your question. If you want to rotate the camera around a fixed scene, do this: from visual import * cube = box() while 1: rate(50) scene.forward = rotate(scene.forward, axis=(0,1,0), angle=0.01) ("forward" is the direction the camera is pointing in.) If on the other hand you want to rotate the object while keeping the camera pointing in a fixed direction, use this loop; while 1: rate(50) cube.rotate(axis=(0,1,0), angle=0.01) The two versions are visually different because in the first case the lighting of the cube doesn't change, whereas in the second case the lighting does change. Bruce Sherwood |