Anyone use VPython?

Arthur ajsiegel at optonline.com
Sun Aug 15 20:50:12 EDT 2004


On 15 Aug 2004 13:58:19 -0700, alikakakhel3 at hotmail.com (Ali) wrote:

>Arthur <ajsiegel at optonline.com> wrote in message news:<69juh0dalfeu39fpvvvcb56ukovl0o1fsb at 4ax.com>...
>> On 14 Aug 2004 20:32:49 -0700, alikakakhel3 at hotmail.com (Ali) wrote:
>> 
>> >Anyone use VPython?
>> 
>> Yes.
>
>ok then how yu make things move?

Hmmm.

Your questions are kind of general..

There are lots of different ways to get things to move.

In the Hanoi demo, clicking the mouse button over a top ring and
keeping it  pressed while moving the mouse.. will move the ring.

Most things in VPython have an attribute called "pos", representing
its 3d coorinates

Experiment from the IDLE prompt.

IDLE 1.0.3      
>>> from visual import *
Visual 2004-07-22
>>> s=sphere(color=color.blue, pos=(2,2,2))   

You will see a window with a blue sphere.

Then:
>>> s.pos=(0,2,2)

The sphere's position in the window moved.

Cool.

Moving things in Vpython is usually a matter of having a porgram that
changes things "pos", in reaction to something - a mouse click, the
passage of seconds, etc.

Help?

Art






More information about the Python-list mailing list