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