02: Raycaster based look interaction
This post was published in 2016 and is kept here for reference. It may contain information that's outdated or inaccurate. All external links and references have been updated to point to archived versions on archive.org where possible.
For today’s Cardboctober hack I’m doing some basic look interaction.
As you look at each ghost in the circle surrounding you the ghost will cover their eyes.

This is really basic, and uses Three’s built-in THREE.Raycaster. You can imagine a raycaster as a laser beam shining from your eye to the point that you’re looking at.

In this hack I’m grabbing the first object that the raycaster hits and then changing the material.
Cardboctober day 2
View this Cardboctober hack • View the source code on Github
View the other submissions for day 2 on the Cardboctober website.
Check out all of my other Cardoctober posts here: /cardboctober.
This post is also available in plain text