alice-teacher Object in Camera View

Don Slater dslater at andrew.cmu.edu
Thu Jan 17 13:23:13 EST 2013


On Jan 17, 2013, at 1:04 PM, Laurie Dutchen <ldutche at glencove.k12.ny.us> wrote:

> HELP!!!
>  
> I have a student who is trying to complete a project and we have hit a brick wall!
>  
> He wants to be able to determine when an object comes into the camera’s view.  How can we do that?
>  
> Thanks,
> Laurie Dutchen
> Math/Computer Science Teacher
> Glen Cove High School
> Glen Cove, NY


<Reply from Don Slater; others may have different and better thoughts>

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.

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 "You are now in view of the camera" and / or another sign that tells them "You are now leaving the view of the camera". 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:

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

	if obj.distance to marker is less than 2.5 meters
		// obj is in camera view; do what the obj should do

There are some assumptions here, that the obj and the marker are in line, and the camera is static (not moving)

If the object is not in line with the marker than the distance value may have to be tweaked…

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.

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.

All the best,
Don Slater


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20130117/62724444/attachment.html 


More information about the alice-teachers mailing list