Jonathan has explained the general approach. But if you're just rotating
about the y axis see stonehenge.py (one of the VPython sample programs)
in which sideways mouse motions rotate scene.forward and vertical mouse
motions move scene.center forward and back, with the effect that you can
fly through the scene. For sliders, see colorsliders.py or
controltest.py. For keyboard interactions, see that section of the
VPpython help accessible from within IDLE.
Bruce Sherwood
Jonathan Brandmeyer wrote:
>On Fri, 2006-08-11 at 09:37 +0300, Andrey Antonov wrote:
>
>
>>Hi,
>>
>>Suppose that we have a scene with objects.
>>I'd like to assign to a key or a slider possibility to rotate the scene
>>uniformly like to move point of view on a parallel or meridian associated
>>with
>>scene.center. I need help (or more explanations, or samples or links) about
>>the iteration formulas for changing the point of view, I mean in cartesian,
>>spherical or cylindrical coordinates for example.
>>
>>
>
>The orientation of the camera is computed using forward, up, center, and
>range. In most cases, in order to simply rotate the camera about it's
>center, you will want to
>-compute the appropriate 3x3 rotation matrix
>-multiply scene.forward by it, and assign the result to scene.forward.
>
>Google for glRotate to get the definition of a rotation matrix that
>VPython uses. Alternatively, look at the sources. In VPython 4.x,
>src/core/display_kernel.cpp: display_kernel::report_mouse_motion()
>handles the effects of dragging the mouse around the window.
>src/core/util/tmatrix.cpp includes a routine for constructing a rotation
>matrix as well.
>
>HTH,
>-Jonathan
>
>
>-------------------------------------------------------------------------
>Using Tomcat but need to do more? Need to support web services, security?
>Get stuff done quickly with pre-integrated technology to make your job easier
>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>_______________________________________________
>Visualpython-users mailing list
>Vis...@li...
>https://lists.sourceforge.net/lists/listinfo/visualpython-users
>
>
|