Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

three.js mouse event handler

Tags:

three.js

webgl

I am new using three.js. I have created a mesh cube and want to make it disappear by mouse click. how can i do that? any help or good tutorial

like image 511
astonish Avatar asked Dec 20 '25 15:12

astonish


1 Answers

There are couple of things you can do depending on what you want.

  1. You can remove it from the scene (scene.remove()).
  2. You can make it transparent (material.transparent = true; material.opacity = 0.0;)
  3. You can move it out of the view.
like image 136
gaitat Avatar answered Dec 23 '25 04:12

gaitat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!