Three.js Raycaster Tutorial | How to Handle Mouse Input in Three.js

Опубликовано: 27 Октябрь 2024
на канале: Suboptimal Engineer
15,909
446

In this coding tutorial, we go over raycasting in Three JS. We start off by learning when you may want to use a raycaster. Then initialize the raycaster code in our 3D scene. Finally, we detect the objects intersecting with the raycaster and update them with a mouse click.

📖 Code - https://github.com/SuboptimalEng/thre...
🎥  YouTube -    / suboptimaleng  
🐦 Twitter -   / suboptimaleng  
📸  Instagram -   / suboptimaleng  
💻 GitHub - https://github.com/SuboptimalEng
🌎  Website - https://suboptimaleng.com

== [ Resources ] ==
Three.js Examples - https://threejs.org/examples/

== [ Timestamps ] ==
00:00 What is a Raycaster?
00:37 Three.js Setup Guide
01:09 Set up Raycaster + Detect Objects
02:11 Update All Intersecting Objects
02:40 Update First Intersecting Object

== [ Tags ] ==
#suboptimal #threejs #gamedev