VPython 5.70: easy way to add a trail to a moving object

Bruce Sherwood <[email protected]>
Newsgroups gmane.comp.python.visualpython.user
Message-ID <[email protected]>
VPython 5.70 now available at vpython.org adds an easy to add a trail
to a moving object:

ball = sphere(.... make_trail=True ....)

The object can be an arrow, box, cone, cylinder, ellipsoid, pyramid,
ring, or sphere

If you create the object with make_trail=False, the trail won't start
until and unless you later say make_trail=True. In order to make any
trail you must specify make_trail to be True of False when you create
the object.

Additional options:

trail_type     Default is "curve", but can be "points"

interval        If interval=10, a point is added to the trail only
every 10th move of the object

retain          If retain=50, only the 50 most recently added points
will be retained

trail_object  The curve or points object;
ball.trail_object.color=color.orange will change the color of the
trail to orange

There were two motivations for offering this. The first is simply that
leaving a trail behind a moving object is a common task in VPython,
and it is a bit annoying to have to create a curve object and do
appends with or without retains. It is a bit more annoying to specify
skipping points.

A second major reason for implementing easier trail creation comes
from recent research by Shawn Weatherford at North Carolina State
University. Shawn, a Ph.D. student of Ruth Chabay, ran a lab section
in which students gave permission for extensive video and audio
recording of their work throughout the semester, which included
experiments, group problem-solving, and computational modeling using
VPython. Shawn presented his data last week and showed that one of the
most common student difficulties had to do with making an object leave
a trail.

These are first-year and second-year engineering and science students
in an introductory physics course. The students are facile with
computers except for programming, which is new to almost all of them.
Just as Stephen Hawking's publisher warned him that every equation he
included in "A Brief History of Time" would cost him half his
potential readership, so in this programming environment every
non-physics element can cause a significant rise in student
difficulty, because it distracts attention away from concentrating on
the physics and toward language syntax.

Particularly alarming was the observation that when students were
asked to read through a partially complete program, to exercise the
important skill of being able to read a program, frequently the
students would see "curve" (needed to implement a trail) and say, "Oh,
the spaceship is going to curve, and here is the programming statement
that will make it curve"!!!! Sigh. Hopefully adding "make_trail=True"
won't trigger this kind of mindlessness.

Bruce Sherwood

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.