A photo of Max Glenister Max Glenister

02: Raycaster based look interaction

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

View this Cardboctober hack 02: Raycaster based look interaction

View the other submissions for day 02 on the Cardboctober website.

To see the latest Cardboctober hacks, follow @cardboctober on Twitter

Check out my other Cardoctober posts here: /cardboctober

About the author

A photo of Max Glenister

Max Glenister

Max Glenister is a Front-end Developer based in Oxfordshire. For work he spends his time designing, validating and implementing user interfaces. For fun he tinkers with Virtual Reality, 3D printing, embedded systems, game development and many other things.

You can keep up with Max on Github, Twitter and Reddit