<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body style="" fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 13px;">
<div style=""><span style="background-color: rgb(255, 255, 255);">Hey Don, Laurie, and et. al.,</span></div>
<div style="background-color: rgb(255, 255, 255);"><br>
</div>
<div style="background-color: rgb(255, 255, 255);">Here is a quick attempt, I think you could make it work. I added a couple of 3-D text objects, the text is just 10 dashes, add more for the desired length. I just wanted an object that was essentially long,
 short and skinny. I'm sure there is a better object, I didn't work very hard at looking. Maybe a billboard with a long, short image would work well.</div>
<div style="background-color: rgb(255, 255, 255);"><br>
</div>
<div style="background-color: rgb(255, 255, 255);">I made two 3-D images and positioned them at the limits or edges of what I can see from the camera. Maybe you'd want them just out of sight, it depends upon what you're trying to do. In a &quot;real&quot; world I suspect
 you would want to make them invisible.&nbsp;</div>
<div style="background-color: rgb(255, 255, 255);"><br>
</div>
<div style="background-color: rgb(255, 255, 255);">Now I just continually check to see it the desired object is between the two &quot;edges&quot;. Because of the quirks of the 3-D text I had to check to see if the car was in front of one edge and behind the other. It
 had to do with how I turned them either 90° or 270° when positioning them. You'd probably have the same issue with a billboard. You might want to check distance from the edges for more accuracy. I just going for &quot;proof of concept, which is code for me being
 too lazy to really did into it right now :-).</div>
<div style="background-color: rgb(255, 255, 255);"><br>
</div>
<div style="background-color: rgb(255, 255, 255);">If the objects are stationary and the camera moves make the vehicle for the edges be the camera.</div>
<div style="background-color: rgb(255, 255, 255);"><br>
</div>
<div style="background-color: rgb(255, 255, 255);">It's very rough but I think it should work. If I get back to creating tutorials for how to do different &quot;tricks&quot; or &quot;techniques&quot; this is definitely one I'd add to the collection.</div>
<div style="background-color: rgb(255, 255, 255);"><br>
</div>
<div style="background-color: rgb(255, 255, 255);">Let me know if and how it works for you. If anyone cleans it up and gets it working well let us know.</div>
<div style="background-color: rgb(255, 255, 255);"><br>
</div>
<div style="background-color: rgb(255, 255, 255);">Tom</div>
<div style="background-color: rgb(255, 255, 255);">That guy from North Dakota</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF592166" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> alice-teachers-bounces&#43;tstokke=cs.und.edu@lists.andrew.cmu.edu [alice-teachers-bounces&#43;tstokke=cs.und.edu@lists.andrew.cmu.edu] on behalf of Don Slater
 [dslater@andrew.cmu.edu]<br>
<b>Sent:</b> Thursday, January 17, 2013 12:23 PM<br>
<b>To:</b> Laurie Dutchen; Alice Teachers<br>
<b>Subject:</b> Re: alice-teacher Object in Camera View<br>
</font><br>
</div>
<div></div>
<div>
<div>
<div>On Jan 17, 2013, at 1:04 PM, Laurie Dutchen &lt;<a href="mailto:ldutche@glencove.k12.ny.us" target="_blank">ldutche@glencove.k12.ny.us</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div lang="EN-US">
<div class="Section1" style="">
<div style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:Arial"><font size="2" face="Arial"><span style="font-size:10pt">HELP!!!</span></font></div>
<div style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:Arial"><font size="2" face="Arial"><span style="font-size:10pt">&nbsp;</span></font></div>
<div style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:Arial"><font size="2" face="Arial"><span style="font-size:10pt">I have a student who is trying to complete a project and we have hit a brick wall!</span></font></div>
<div style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:Arial"><font size="2" face="Arial"><span style="font-size:10pt">&nbsp;</span></font></div>
<div style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:Arial"><font size="2" face="Arial"><span style="font-size:10pt">He wants to be able to determine when an object comes into the camera’s view.&nbsp; How can we do that?</span></font></div>
<div style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:Arial"><font size="2" face="Arial"><span style="font-size:10pt">&nbsp;</span></font></div>
<div style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:Arial"><font size="2" face="Arial"><span style="font-size:10pt">Thanks,</span></font></div>
<div style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:Arial"><font size="2" face="Arial"><span style="font-size:10pt">Laurie Dutchen</span></font></div>
<div style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:Arial"><font size="2" face="Arial"><span style="font-size:10pt">Math/Computer Science Teacher</span></font></div>
<div style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:Arial"><font size="2" face="Arial"><span style="font-size:10pt">Glen Cove</span></font><font size="2"><span style="font-size:10pt">&nbsp;High School</span></font><font size="2"><span style="font-size:10pt"></span></font></div>
<div style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:Arial"><font size="2" face="Arial"><span style="font-size:10pt">Glen Cove</span></font><font size="2"><span style="font-size:10pt">,&nbsp;NY</span></font><font size="2"><span style="font-size:10pt"></span></font></div>
</div>
</div>
</blockquote>
</div>
<div>
<div lang="EN-US">
<div class="Section1" style="">
<div style="margin:0in 0in 0.0001pt; font-size:11pt; font-family:Arial"><font size="2"><span style="font-size:10pt"><br>
</span></font></div>
</div>
</div>
</div>
<div>&lt;Reply from Don Slater; others may have different and better thoughts&gt;</div>
<div><br>
</div>
That is an interesting and difficult question… Ask the student to think about it this way, how do they know when they have walked into the view of a camera that is pointed in their general direction.
<div><br>
</div>
<div>Virtually impossible, unless there has been some indicators for the students to let them know that they are now in view, i.e. a sign that tells them &quot;You are now in view of the camera&quot; and / or another sign that tells them &quot;You are now leaving the view
 of the camera&quot;. So what they might do is put a marker in the center of the camera view, make it invisible, figure out how far to the left or right of the marker the object can be and still be in camera view, and then check the distance:</div>
<div><br>
</div>
<div>For example, the student figures out that an object can be 2.5 meters to the left or 2.5 meters to the right of the marker and still be in the camera view. So the conditional statement will be something like</div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>if obj.distance to marker is less than 2.5 meters</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>// obj is in camera view; do what the obj should do</div>
<div><br>
</div>
<div>There are some assumptions here, that the obj and the marker are in line, and the camera is static (not moving)</div>
<div><br>
</div>
<div>If the object is not in line with the marker than the distance value may have to be tweaked…</div>
<div><br>
</div>
<div>If the camera is moving, than set the marker's vehicle to be the camera, so that as the camera moves, the marker moves with it, maintaining its relative position.</div>
<div><br>
</div>
<div>Let me know if you have any other questions. I am also going to post this question to the Alice Educator's Mailing list to see if what other solutions are out there.</div>
<div><br>
</div>
<div>All the best,</div>
<div>Don Slater</div>
<div><br>
<div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>