<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-size: 13px;color: rgb(0, 0, 0);font-family: Arial;">Don, I tried it as best as I could understand<br>Take into account the one second; each second the chicken would be facing a different direction so the "move" would change<br><br>-=mh=-<br><br><blockquote style="padding-left: 5px; margin-left: 0px; border-left: #0000ff 2px solid; font-weight: normal; font-style: normal; text-decoration: none; font-size: 10pt; font-family: arial,sans-serif; color: black;">-----Original Message-----<br>>From: alice-teachers-request@lists.andrew.cmu.edu<br>>Sent: Feb 11, 2017 12:00 PM<br>>To: alice-teachers@lists.andrew.cmu.edu<br>>Subject: alice-teachers Digest, Vol 77, Issue 8<br>><br>>Send alice-teachers mailing list submissions to<br>> alice-teachers@lists.andrew.cmu.edu<br>><br>>To subscribe or unsubscribe via the World Wide Web, visit<br>> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers<br>>or, via email, send a message with subject or body 'help' to<br>> alice-teachers-request@lists.andrew.cmu.edu<br>><br>>You can reach the person managing the list at<br>> alice-teachers-owner@lists.andrew.cmu.edu<br>><br>>When replying, please edit your Subject line so it is more specific<br>>than "Re: Contents of alice-teachers digest..."<br>><br>><br>>Today's Topics:<br>><br>> 1. Re: Question about move toward (Vanderhyde, James)<br>><br>><br>>----------------------------------------------------------------------<br>><br>>Message: 1<br>>Date: Fri, 10 Feb 2017 20:19:30 0000<br>>From: "Vanderhyde, James" <vanderhyde@sxu.edu><br>>To: Alice educators <alice-teachers@lists.andrew.cmu.edu><br>>Subject: Re: alice-teacher Question about move toward<br>>Message-ID: <e3c731d7-bbee-436e-8bc9-8437cedc7ef9@sxu.edu><br>>Content-Type: text/plain; charset="utf-8"<br>><br>>Don, thanks. You explained the problem I was having exactly.<br>><br>>Michael, thanks. Using a hub is good work around. I also prefer using hubs over ?as seen by.? After Don wrote, I thought maybe ?as seen by bunny? would work, but it doesn?t unless the bunny is facing the right way. The chicken moves in a straight line, but in the direction the ?as seen by? object is facing. In essence, whether you use ?as seen by? or the vehicle property, the result is the same.<br>><br>>I?m having trouble understanding why ?move to? and ?move toward? don?t work the same way under the hood. They are grouped together in the methods pane, so it seems like they should have similar behavior (absolute, not relative movement). I am trying to understand how ?move toward? works at all. If you use it by itself, it doesn?t matter what way the object is facing, so it gives the appearance of being independent of the facing direction, as "move to" is.<br>><br>>Don, you say ?move toward? is relative to the object?s orientation, but it seems that in some cases it is, and in some cases it isn?t. This is why it feels like a bug to me.<br>><br>>Consider these three cases:<br>><br>> chicken move amount = 2 meters toward target = bunny<br>>This one moves the chicken toward the bunny, as advertised, regardless of which way either of them is facing.<br>><br>> chicken move amount = 2 meters toward target = bunny asSeenBy = chicken<br>>This one behaves exactly the same as the above case.<br>><br>> chicken move amount = 2 meters toward target = bunny asSeenBy = bunny<br>>This one is the weird case. The chicken moves in a direction that is some kind of combination of the direction the chicken is facing, the direction the bunny is facing, and the vector between them. The formula for the direction the chicken moves appears to be b-c d, where b vector is the direction the bunny is facing, c vector is the direction the chicken is facing, and d vector is the vector from the chicken to the bunny. (Of note is if the bunny and chicken are facing the same direction, they cancel out and the chicken moves toward the bunny as expected.)<br>><br>>This formula explains the unexpected behavior of moving in a circle instead of moving straight while turning on an axis. The direction the chicken moves each frame is thus c?-c d, where c is the direction the chicken is facing at the beginning of the movement, and c? is the direction the chicken is currently facing. This makes a straight line when the chicken is not turning, but a somewhat circular shape when the chicken is turning.<br>><br>>This is fascinating, but I shouldn?t be spending so much time on this. I need to practice better time management. Thanks for looking into it.<br>><br>>James<br>>?<br>>James Vanderhyde<br>>Assistant Professor, Computer Science<br>>Program Director, Master of Applied Computer Science<br>>Saint Xavier University<br>>3700 W. 103rd St.<br>>Chicago, IL 60655<br>>773-298-3454<br>><br>>On Feb 10, 2017, at 12:41 PM, Michael L Owen via alice-teachers <alice-teachers@lists.andrew.cmu.edu<mailto:alice-teachers@lists.andrew.cmu.edu>> wrote:<br>><br>>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.<br>><br>>Mike Owen<br>><br>><br>>________________________________<br>>From: alice-teachers <alice-teachers-bounces mrgrog="outlook.com@lists.andrew.cmu.edu<mailto:alice-teachers-bounces">> on behalf of Donald Slater via alice-teachers <alice-teachers@lists.andrew.cmu.edu<mailto:alice-teachers@lists.andrew.cmu.edu>><br>>Sent: Friday, February 10, 2017 10:19 AM<br>>To: Alice Teachers<br>>Subject: Re: alice-teacher Question about move toward<br>><br>>Jim,<br>>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).<br>><br>>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.<br>><br>>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.<br>><br>>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).<br>><br>>I believe that this is generating the behavior your student was looking for.<br>><br>>I have to tell you, you and your students always come up with interesting questions, and I enjoy wrestling with them.<br>><br>>Let me know if I misunderstood or if there are any other questions?<br>><br>><rotating chicken.png=""><br>><br>>All the best,<br>>Don Slater<br>><br>>Alice Project<br>>Carnegie Mellon University<br>>Entertainment Technology Center<br>>700 Technology Drive<br>>Pittsburgh, PA 15219<br>><br>>Email: dslater@cmu.edu<mailto:dslater@cmu.edu><br>><br>>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.<br>>--- Henry David Thoreau<br>><br>>The true object of all human life is play. -- G.K. Chesterton<br>><br>><br>>On Feb 9, 2017, at 4:22 PM, Vanderhyde, James via alice-teachers <alice-teachers@lists.andrew.cmu.edu<mailto:alice-teachers@lists.andrew.cmu.edu>> wrote:<br>><br>>I am using Alice 2.4.3. One of my students today produced unexpected behavior using ?move toward.? Consider this code:<br>><br>> Do together<br>> chicken turn left 1 revolution<br>> chicken move amount = 2 meters toward target = bunny<br>><br>>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.<br>><br>>Is this a bug or desired behavior? If desired, can someone explain it to me?<br>><br>>James<br>>?<br>>James Vanderhyde<br>>Assistant Professor, Computer Science<br>>Program Director, Master of Applied Computer Science<br>>Saint Xavier University<br>>3700 W. 103rd St.<br>>Chicago, IL 60655<br>>773-298-3454<br>><br>>_______________________________________________<br>>alice-teachers mailing list<br>>alice-teachers@lists.andrew.cmu.edu<mailto:alice-teachers@lists.andrew.cmu.edu><br>>https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers<br>><br>><spinningchicken.a2w>_______________________________________________<br>>alice-teachers mailing list<br>>alice-teachers@lists.andrew.cmu.edu<mailto:alice-teachers@lists.andrew.cmu.edu><br>>https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers<br>><br>>-------------- next part --------------<br>>An HTML attachment was scrubbed...<br>>URL: <http: lists.andrew.cmu.edu="" pipermail="" alice-teachers="" attachments="" 20170210="" 63c26894="" attachment-0001.html=""><br>><br>>------------------------------<br>><br>>Subject: Digest Footer<br>><br>>_______________________________________________<br>>alice-teachers mailing list<br>>alice-teachers@lists.andrew.cmu.edu<br>>https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers<br>><br>><br>>------------------------------<br>><br>>End of alice-teachers Digest, Vol 77, Issue 8<br>>*********************************************<br></http:></mailto:alice-teachers@lists.andrew.cmu.edu></spinningchicken.a2w></mailto:alice-teachers@lists.andrew.cmu.edu></alice-teachers@lists.andrew.cmu.edu<mailto:alice-teachers@lists.andrew.cmu.edu></mailto:dslater@cmu.edu></rotating></alice-teachers@lists.andrew.cmu.edu<mailto:alice-teachers@lists.andrew.cmu.edu></alice-teachers-bounces></alice-teachers@lists.andrew.cmu.edu<mailto:alice-teachers@lists.andrew.cmu.edu></e3c731d7-bbee-436e-8bc9-8437cedc7ef9@sxu.edu></alice-teachers@lists.andrew.cmu.edu></vanderhyde@sxu.edu></blockquote></div></body></html>