Video Thumbnail

Sign up for a plan to instantly unlock all premium lessons.

UNLOCK LESSON

Premium Features

Download Video

Mobile Event Listeners

Published 2 years ago

Previously, we resized our scene to fit the smaller screen proportions associated with phones and tablets. However, you may have noticed, when testing on an actual mobile device, the globe doesn't spin like it does on desktop.

In this video, we'll cover how to add mobile event listeners to our project so we can reobtain the spin effect on mobile.

The step-by-step process will be:

  • Add event listeners

  • Swap out clientX and clientY

  • Test if raycaster intersects with sphere

  • If length is greater than 0, set mouse.down to true

  • Set passive: false if needed

  • If mouse.down, prevent default and spin

  • Test on a mobile phone

Comments

Want to participate?

Create a free Chris Courses account to begin

Login
b
bunnynomics posted 2 years ago
0
a
absurd posted 2 years ago
0
b
bigd posted 3 years ago
1
chris posted 3 years ago
4
j
jeantimex posted 6 months ago
0

Providing the lift to launch your development career

© 2024 Chris Courses. All rights reserved.