Documentation of attach_trail and attach_arrow

11 views
Skip to first unread message

Bruce Sherwood

unread,
Apr 19, 2016, 6:42:01 PM4/19/16
to Glowscript Users
At the following location in the GlowScript VPython Help, also accessible from "Work with 3D Objects > Attach a Trail or Arrow", are links to the attach_trail and attach_arrow objects:


attach_trail is a somewhat more powerful version of the make_trail mechanism. It includes the capability of specifying a function to be executed to obtain a position to be added to the trail rather than using the position of an object.

attach_arrow lets you specify that an arrow be continually displayed at the location of a moving object, with a length and direction of an attribute of the moving object, multiplied by an optional scale factor. For example, if s represents a sphere with velocity s.velocity and force acting on it s.force, you can specify that arrows representing the velocity and force vectors be continuously displayed as the sphere moves:

attach_arrow(s, "velocity", scale=10, color=color.green)
attach_arrow(s, "force", scale=0.3, color=color.red)

Reply all
Reply to author
Forward
0 new messages