alice-teacher Question about move toward

Michael L Owen MrGrog at outlook.com
Fri Feb 10 13:41:44 EST 2017


That option could work, but in my case the chicken moved away because the ground was oriented differently. The attached world uses a different technique in which I attach a hub to an object, and make it the objects vehicle. To move the chicken, you move the hub and the rest of the chicken can do what it wants while you move. I left the hub visible, but it can be made invisible. This technique also comes in handy if you are trying to fly a plane.


Mike Owen


________________________________
From: alice-teachers <alice-teachers-bounces+mrgrog=outlook.com at lists.andrew.cmu.edu> on behalf of Donald Slater via alice-teachers <alice-teachers at lists.andrew.cmu.edu>
Sent: Friday, February 10, 2017 10:19 AM
To: Alice Teachers
Subject: Re: alice-teacher Question about move toward

Jim,
If I understand your question correctly, the student would like the chicken to spin on its own axis while moving toward the bunny, much as the same way the moon would rotate while revolving round the earth (the difference being that the chicken is not orbiting the bunny but moving toward it).

I am not sure that this is a bug, but it is certainly a side-effect of the implementation. I notice that if the chicken moves to the bunny, you do get the behavior I described above. move to  is an absolute command as that essentially Alice is setting the center point of the object to the center point of the target, and then animating that movement.

The idea of move toward, was to provide a way to have one object approach another without colliding with it. Like move, iit is a relational action, using the object's orientation to determine the animation. And in this do together, as you know, that orientation is always changing creating the spinning, just as would happen with a  move.

The solution is to use a different point of view, or orientation, to determine the path of the move toward. In the code snippet I have attached, you will see that I am using the as seen by modifier to tell the chicken to move toward the bunny as seen by the ground. (It turns out that I could also have said as seen by the bunny).

I believe that this is generating the behavior your student was looking for.

I have to tell you, you and your students always come up with interesting questions, and I enjoy wrestling with them.

Let me know if I misunderstood or if there are any other questions…

[cid:B6E847AE-0C72-4970-97A7-5C2B2C2C31DC at fios-router.home]

All the best,
Don Slater

Alice Project
Carnegie Mellon University
Entertainment Technology Center
700 Technology Drive
Pittsburgh, PA 15219

Email: dslater at cmu.edu<mailto:dslater at cmu.edu>

I have learned this at least by my experiment: that if one advances confidently in the direction of his dreams, and endeavors to live the life he has imagined, he will meet with a success unexpected in common hours.
--- Henry David Thoreau

The true object of all human life is play. -- G.K. Chesterton


On Feb 9, 2017, at 4:22 PM, Vanderhyde, James via alice-teachers <alice-teachers at lists.andrew.cmu.edu<mailto:alice-teachers at lists.andrew.cmu.edu>> wrote:

I am using Alice 2.4.3. One of my students today produced unexpected behavior using “move toward.” Consider this code:

 Do together
          chicken turn left 1 revolution
  chicken move amount = 2 meters toward target = bunny

The chicken turns in a circle rather than turning while moving toward the bunny. I know that “move forward” combined with “turn left” will result in circular movement. But I don’t understand why “move toward” is doing it. After all, “move toward” by itself works no matter which way the chicken is facing.

Is this a bug or desired behavior? If desired, can someone explain it to me?

James
—
James Vanderhyde
Assistant Professor, Computer Science
Program Director, Master of Applied Computer Science
Saint Xavier University
3700 W. 103rd St.
Chicago, IL 60655
773-298-3454

_______________________________________________
alice-teachers mailing list
alice-teachers at lists.andrew.cmu.edu<mailto:alice-teachers at lists.andrew.cmu.edu>
https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20170210/e1dfc0cf/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rotating chicken.png
Type: image/png
Size: 44078 bytes
Desc: rotating chicken.png
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20170210/e1dfc0cf/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SpinningChicken.a2w
Type: application/octet-stream
Size: 461119 bytes
Desc: SpinningChicken.a2w
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20170210/e1dfc0cf/attachment-0001.obj>


More information about the alice-teachers mailing list