<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">Don, thanks. You explained the problem I was having exactly.</div>
<div class=""><br class="">
</div>
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.
<div class=""><br class="">
</div>
<div class="">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. </div>
<div class=""><br class="">
</div>
<div class="">
<div class="">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.</div>
<div class=""><br class="">
</div>
</div>
<div class="">Consider these three cases:</div>
<div class=""><br class="">
</div>
<div class=""></div>
<div class="">
<table cellpadding="2" cellspacing="0" width="100%" style="font-family: -webkit-standard;" class="">
<tbody class="">
<tr class="">
<td width="100%" colspan="1" bgcolor="#fff7e6" style="border: 1px solid rgb(192, 192, 192);" class="">
<span style="background-color: rgb(240, 240, 255);" class=""><b class="">chicken</b></span> <b class="">move </b><span style="background-color: rgb(240, 240, 255);" class="">amount = <b class="">2 </b>meters</span> <b class="">toward </b><span style="background-color: rgb(240, 240, 255);" class="">target
= <b class="">bunny</b></span></td>
</tr>
</tbody>
</table>
</div>
<div class="">This one moves the chicken toward the bunny, as advertised, regardless of which way either of them is facing.</div>
<div class=""><br class="">
</div>
<table cellpadding="2" cellspacing="0" width="100%" style="font-family: -webkit-standard;" class="">
<tbody class="">
<tr class="">
<td width="100%" colspan="1" bgcolor="#fff7e6" style="border: 1px solid rgb(192, 192, 192);" class="">
<span style="background-color: rgb(240, 240, 255);" class=""><b class="">chicken</b></span> <b class="">move </b><span style="background-color: rgb(240, 240, 255);" class="">amount = <b class="">2 </b>meters</span> <b class="">toward </b><span style="background-color: rgb(240, 240, 255);" class="">target
= <b class="">bunny</b></span> <span style="background-color: rgb(240, 240, 255);" class="">asSeenBy = <b class="">chicken</b></span></td>
</tr>
</tbody>
</table>
<div class="">This one behaves exactly the same as the above case.</div>
<div class=""><br class="">
</div>
<div class="">
<table cellpadding="2" cellspacing="0" width="100%" style="font-family: -webkit-standard;" class="">
<tbody class="">
<tr class="">
<td width="20" rowspan="3" bgcolor="#ffffe6" style="border-left-width: 1px; border-left-style: solid; border-left-color: rgb(192, 192, 192); border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(192, 192, 192);" class="">
</td>
<td width="100%" colspan="1" bgcolor="#fff7e6" style="border: 1px solid rgb(192, 192, 192);" class="">
<span style="background-color: rgb(240, 240, 255);" class=""><b class="">chicken</b></span> <b class="">move </b><span style="background-color: rgb(240, 240, 255);" class="">amount = <b class="">2 </b>meters</span> <b class="">toward </b><span style="background-color: rgb(240, 240, 255);" class="">target
= <b class="">bunny</b></span> <span style="background-color: rgb(240, 240, 255);" class="">asSeenBy = <b class="">bunny</b></span></td>
</tr>
</tbody>
</table>
</div>
<div class="">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.)</div>
<div class=""><br class="">
</div>
<div class="">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.</div>
<div class=""><br class="">
</div>
<div class="">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.</div>
<div class=""><br class="">
</div>
<div class="">James</div>
<div class="">
<div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
—<br class="">
James Vanderhyde<br class="">
Assistant Professor, Computer Science<br class="">
Program Director, Master of Applied Computer Science<br class="">
Saint Xavier University<br class="">
3700 W. 103rd St.<br class="">
Chicago, IL 60655<br class="">
773-298-3454</div>
</div>
<br class="">
<div>
<div class="">On Feb 10, 2017, at 12:41 PM, Michael L Owen via alice-teachers <<a href="mailto:alice-teachers@lists.andrew.cmu.edu" class="">alice-teachers@lists.andrew.cmu.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div id="divtagdefaultwrapper" dir="ltr" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<div style="margin-top: 0px; margin-bottom: 0px;" class="">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.</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">Mike Owen<br class="">
</div>
<br class="">
<br class="">
<div style="" class="">
<hr tabindex="-1" style="width: 627.1875px; display: inline-block;" class="">
<div id="divRplyFwdMsg" dir="ltr" class=""><font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>alice-teachers <<a href="mailto:alice-teachers-bounces+mrgrog=outlook.com@lists.andrew.cmu.edu" class="">alice-teachers-bounces+mrgrog=outlook.com@lists.andrew.cmu.edu</a>>
on behalf of Donald Slater via alice-teachers <<a href="mailto:alice-teachers@lists.andrew.cmu.edu" class="">alice-teachers@lists.andrew.cmu.edu</a>><br class="">
<b class="">Sent:</b><span class="Apple-converted-space"> </span>Friday, February 10, 2017 10:19 AM<br class="">
<b class="">To:</b><span class="Apple-converted-space"> </span>Alice Teachers<br class="">
<b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: alice-teacher Question about move toward</font>
<div class=""> </div>
</div>
<div class="">Jim,
<div class="">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).</div>
<div class=""><br class="">
</div>
<div class="">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<span class="Apple-converted-space"> </span><b class="">moves to</b> the bunny, you do get the behavior I described above.<span class="Apple-converted-space"> </span><b class="">move
to<span class="Apple-converted-space"> </span></b> 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. </div>
<div class=""><br class="">
</div>
<div class="">The idea of<span class="Apple-converted-space"> </span><b class="">move toward</b>, was to provide a way to have one object approach another without colliding with it. Like<span class="Apple-converted-space"> </span><b class="">move</b>, iit is
a relational action, using the object's orientation to determine the animation. And in this <b class="">do together</b>, as you know, that orientation is always changing creating the spinning, just as would happen with a <b class="">move</b>.</div>
<div class=""><br class="">
</div>
<div class="">The solution is to use a different point of view, or orientation, to determine the path of the<span class="Apple-converted-space"> </span><b class="">move toward</b>. In the code snippet I have attached, you will see that I am using the<span class="Apple-converted-space"> </span><b class=""><i class="">as
seen by</i></b><span class="Apple-converted-space"> </span>modifier to tell the<span class="Apple-converted-space"> </span><i class="">chicken</i><span class="Apple-converted-space"> </span>to<span class="Apple-converted-space"> </span><b class="">move toward</b><span class="Apple-converted-space"> </span>the<span class="Apple-converted-space"> </span><i class="">bunny</i><span class="Apple-converted-space"> </span><b class=""><i class="">as
seen by</i></b><span class="Apple-converted-space"> </span>the<span class="Apple-converted-space"> </span><i class="">ground</i>. (It turns out that I could also have said<span class="Apple-converted-space"> </span><b class=""><i class="">as seen by</i></b><span class="Apple-converted-space"> </span>the<span class="Apple-converted-space"> </span><i class="">bunny</i>).</div>
<div class=""><br class="">
</div>
<div class="">I believe that this is generating the behavior your student was looking for.</div>
<div class=""><br class="">
</div>
<div class="">I have to tell you, you and your students always come up with interesting questions, and I enjoy wrestling with them.</div>
<div class=""><br class="">
</div>
<div class="">Let me know if I misunderstood or if there are any other questions…</div>
<div class=""><br class="">
</div>
<div class=""><span id="cid:B6E847AE-0C72-4970-97A7-5C2B2C2C31DC@fios-router.home"><rotating chicken.png></span></div>
<div class=""><br class="">
</div>
<div class="">All the best,</div>
<div class="">Don Slater</div>
<div class="">
<div class=""><br class="">
Alice Project<br class="">
Carnegie Mellon University<br class="">
Entertainment Technology Center<br class="">
700 Technology Drive<br class="">
Pittsburgh, PA 15219<br class="">
<br class="">
Email:<span class="Apple-converted-space"> </span><a href="mailto:dslater@cmu.edu" class="">dslater@cmu.edu</a><br class="">
<br class="">
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 class="">
--- Henry David Thoreau<br class="">
<br class="">
The true object of all human life is play. -- G.K. Chesterton<br class="">
<br class="">
</div>
<br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On Feb 9, 2017, at 4:22 PM, Vanderhyde, James via alice-teachers <<a href="mailto:alice-teachers@lists.andrew.cmu.edu" class="">alice-teachers@lists.andrew.cmu.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">I am using Alice 2.4.3. One of my students today produced unexpected behavior using “move toward.” Consider this code:
<div class=""><br class="">
</div>
<div class="">
<table width="100%" cellspacing="0" cellpadding="2" class="">
<tbody class="">
<tr class="">
<td bgcolor="#f2e6ff" colspan="2" style="border-top-color: rgb(192, 192, 192); border-right-color: rgb(192, 192, 192); border-left-color: rgb(192, 192, 192); border-top-width: 1px; border-right-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-left-style: solid;" class="">
<b class="">Do together</b></td>
</tr>
<tr class="">
<td width="20" bgcolor="#f2e6ff" rowspan="2" style="border-bottom-color: rgb(192, 192, 192); border-left-color: rgb(192, 192, 192); border-bottom-width: 1px; border-left-width: 1px; border-bottom-style: solid; border-left-style: solid;" class="">
</td>
<td width="100%" bgcolor="#fff7e6" colspan="1" style="border: 1px solid rgb(192, 192, 192); border-image-source: none;" class="">
<span style="background-color: rgb(240, 240, 255);" class=""><b class="">chicken</b></span> <b class="">turn </b><span style="background-color: rgb(240, 240, 255);" class=""><b class="">left</b></span> <span style="background-color: rgb(240, 240, 255);" class=""><b class="">1 </b>revolution</span></td>
</tr>
<tr class="">
<td width="100%" bgcolor="#fff7e6" colspan="1" style="border: 1px solid rgb(192, 192, 192); border-image-source: none;" class="">
<span style="background-color: rgb(240, 240, 255);" class=""><b class="">chicken</b></span> <b class="">move </b><span style="background-color: rgb(240, 240, 255);" class="">amount = <b class="">2 </b>meters</span> <b class="">toward </b><span style="background-color: rgb(240, 240, 255);" class="">target
= <b class="">bunny</b></span></td>
</tr>
</tbody>
</table>
<div class=""><br class="">
</div>
</div>
<div class="">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.</div>
<div class=""><br class="">
</div>
<div class="">Is this a bug or desired behavior? If desired, can someone explain it to me?</div>
<div class=""><br class="">
</div>
<div class="">James<br class="">
<div class="">
<div style="text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal;" class="">
—<br class="">
James Vanderhyde<br class="">
Assistant Professor, Computer Science<br class="">
Program Director, Master of Applied Computer Science<br class="">
Saint Xavier University<br class="">
3700 W. 103rd St.<br class="">
Chicago, IL 60655<br class="">
773-298-3454</div>
</div>
<br class="">
</div>
</div>
_______________________________________________<br class="">
alice-teachers mailing list<br class="">
<a href="mailto:alice-teachers@lists.andrew.cmu.edu" class="">alice-teachers@lists.andrew.cmu.edu</a><br class="">
<a href="https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers" class="">https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</div>
<span id="cid:60493860-B7D3-45F2-9D70-00B6CB742C99@SXU.local"><SpinningChicken.a2w></span><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">alice-teachers
mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<a href="mailto:alice-teachers@lists.andrew.cmu.edu" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">alice-teachers@lists.andrew.cmu.edu</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<a href="https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
</div>
</div>
<br class="">
</div>
</body>
</html>