Re: Forward direction

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Forward direction

Edward Mokurai Cherlin
On Tue, September 25, 2012 11:08 pm, Steve Thomas wrote:
> Edward,
>
> I think you may have uncovered a bug (although it may exist in the model
> inside my head).

Misfeature, I think. It doesn't break anything, but is only a design error.

> I can take a polygon 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.

Exactly so. I'll add that point to the manual. Also the term costume.
I like that.

>  This does not make sense to me.
>
> Also the Balloon help for "heading" states: "Which direction the object is
> facing. 0 is straight up"

Definitely uninformative. The important fact is that heading is the
direction in which the object will move.

> The Balloon help for "forward direction" states: "The angle of my forward
> direction without rotating myself"

Definitely meaningless.

> Okay, so I may be starting to get this but it seems harder than it should
> be.
>
> To my simple mind, there are two things:
>
>    1.   the rotation of the costume, where its "original" value is 0 (ie:
>    straight up) (Seems like this should map to "heading" but my case above
>    provides a counter example.
>    2.   the "forward direction" which is the direction it will move in.

You have it backwards, which does not surprise me in the confused
state of the help and the documentation.

> Thus changing forward direction should not IMNSHBOWO change heading.
> Of course at this point we probably do not want to change existing
> behavior
> which could break old projects. So we may have to document as is.

I'll do my best.

> Stephen
> IMNSHBOWO - In My Not So Humble But Often Wrong Opinion
>
>
> On Tue, Sep 25, 2012 at 7:08 PM, Edward Mokurai Cherlin <
> [hidden email]> wrote:
>
>> On Tue, September 25, 2012 12:56 pm, karl ramberg wrote:
>> > On Mon, Sep 24, 2012 at 8:49 AM, Edward Mokurai Cherlin
>> > <[hidden email]> wrote:
>>
>> >> forward direction: What effect or use does it have?
>> >
>> > Each player has a direction arrow that can be changed by clicking on
>> > it while holding shift.
>> > If it's not visible you can check the box 'direction arrow' in halo
>> menu.
>> > When you tell a player to move forward it will move in the direction
>> > of the arrow.
>>
>> This turns out not to answer the question I asked. You are describing
>> the heading, not the forward direction.
>>
>> Objects move in the direction of their heading, which is the direction
>> of the Halo arrow, but not necessarily the same as the forward
>> direction. Rotating the Morph with the Rotate handle in the Halo
>> changes the heading but not the forward direction. Turning on the
>> direction arrow, and then grabbing it with a shift-click and turning
>> it, changes both the forward direction and the heading. These two
>> values can be edited in the viewer as well. Editing the heading leaves
>> the forward direction unchanged. Editing the forward direction also
>> changes the heading. The command Object forward by 5 moves the Morph
>> in the heading direction. I see nothing in Etoys that makes use of the
>> forward direction.
>>
>> In Squeak, we see for the Morph class:
>>
>> heading
>>         "Return the receiver's heading (in eToy terms)"
>>         owner ifNil: [^ self forwardDirection].
>>         ^ self forwardDirection + owner degreesOfFlex
>>
>> forwardDirection: newDirection
>>         "Set the receiver's forward direction (in eToy terms)"
>>         self setProperty: #forwardDirection toValue: newDirection.
>>
>> degreesOfFlex
>>         "Return any rotation due to flexing"
>>         "NOTE: because renderedMorph, which is used by the halo to set
>> heading, goes down through dropShadows as well as transformations, we
>> need this method (and its other implems) to come back up through such
>> a chain."
>>         ^ 0.0
>>
>> and so on.
>>
>> Also in Squeak, I see 19 senders of forwardDirection in 12 classes,
>> which I do not feel ready to explore until after I learn rather more
>> Squeak and Smalltalk. I can feel it coming on. ^_^

--
Edward Mokurai (默雷/निशब्दगर्ज/نشبدگرج) Cherlin
Silent Thunder is my name, and Children are my nation.
The Cosmos is my dwelling place, the Truth my destination.
http://wiki.sugarlabs.org/go/Replacing_Textbooks


--
Edward Mokurai (默雷/निशब्दगर्ज/نشبدگرج) Cherlin
Silent Thunder is my name, and Children are my nation.
The Cosmos is my dwelling place, the Truth my destination.
http://wiki.sugarlabs.org/go/Replacing_Textbooks
_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev