Page 1 of 1

How to create a Laser Light Detector?

PostPosted: Fri Jun 03, 2016 1:46 am
by aldo681001
Hi

How do I create a (non-destructive) laser light detector?

thank you

Re: How to create a Laser Light Detector?

PostPosted: Fri Jun 03, 2016 6:04 pm
by grantypoo
A little information might go a long way in helping... describe the scene you are creating and what you want to have happen.

But without knowing anything about what you're doing, here is my suggestion.

You can put in your lasers scripting code to change the color of whatever it hits. You can look at my scene here where I do it with 5 or 6 different lasers. I right clicked the laser, went into scripting and put this code into the "OnLaserHit" section. It makes the object the laser strikes take on the color of the laser.

(e)=>{e.geom.color = e.this.color}

That's one way to visually detect that a laser hit something.

Rating: rated 6.1
Filesize: 227.03 kB
Comments: 4
Ratings: 3
download

Re: How to create a Laser Light Detector?

PostPosted: Sun Jun 19, 2016 2:38 am
by icrls984
Like grantypoos said, this is lacking information. :?
With that being said, there are actually two ways to detect if a laser is hitting a geometry: in the laser onLaserHit, and in the geometry onHitByLaser. These events trigger if a laser hits a geometry, and if a geometry is hit by a laser, in that order. Depending on what you are using to detect the laser, you might have to use one, or maybe both.