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

preview_player
Показать описание
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.

== [ Resources ] ==

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

== [ Tags ] ==
#suboptimal #threejs #gamedev
Рекомендации по теме
Комментарии
Автор

Short and sweet, not too fast and easy to understand. Thanks!

gun-ep
Автор

hi i am trying to create a shooting gun, so do i need to use raycaster for that ?

dhruvyadav
Автор

What wonderful class bro 10☆.
How can I use the cellphone touch to do the same thing buddy?

bestapps
Автор

How can I translate the coordinate values that we get from the mouse to 3D world values? My object is at (0, 50) but mouseX and mouseY are 0 something.

dawnriddler
Автор

Hey nice tutorial, but can you help me with something.
Instead of mousemove, i did "click" to only cast ray when clicked. But when i use orbit controls to rotate my camera and my pointer is on the object and when i "mouseup" (leave orbit rotation), it triggers click event on the object.
I only want click event when not using orbit controls. just simple click

ultrawhiff
Автор

Awesome! can you do a video on how this can be done to raycast on a imported object like fbx?

FS-yqef
Автор

How to render exploded views so that user can slide to control exploded view.

rallysahil
Автор

good tutorial but also add source code in discription

sandeepGupta-udns
Автор

Buen video, como hacerlo para angular cli, no me funciona, me retorna un array null 🥲

gerardocardenas