[etoys-dev] Forward direction (was Re: First draft of Etoys Reference Manual Glossary)

Bert Freudenberg bert at freudenbergs.de
Wed Sep 26 09:38:26 EDT 2012

On 2012-09-26, at 05:08, Steve Thomas <sthomas1 at gosargon.com> wrote:

> Edward,
> I think you may have uncovered a bug
> I can take a polygon

Polygons are very special. You could have used almost any other object. The preferred means of creating an object in Etoys is by using the paint tool.

> from the Supplies flap and it starts out with its heading and forward direction as 0.
> Then if I first change the forward direction to 180 and then change the heading to 0 (which also changes the forward direction to 0) I wind up with the polygon costume turned 180, but heading and forward direction both 0.  This does not make sense to me.

This is because polygons are not rotated like other objects. When rotating a polygon, its vertices get changed. The new heading is recorded in the polygon's forward direction. That means that for polygons, heading and forward direction are intrinsically linked, unlike for any other object where they are independent.

The reason polygons are different is so that they do not get magnified like a sketch when resized, but they keep their border width.

One way to think of it is this: when an object's forward direction is the same as its heading (+/- 360 degrees) then its screen image appears unrotated from its "intrinsic" image. That's always the case for polygons because rotating the polygon changes its internal orientation, whereas for sketches the original sketch is not modified so it needs to keep track of the forward direction independently of its heading.

- Bert -

More information about the etoys-dev mailing list