tyFlow Forum
TySpline line of sight lasers - Printable Version

+- tyFlow Forum (https://forum.tyflow.com)
+-- Forum: tyFlow Discussion (https://forum.tyflow.com/forum-1.html)
+--- Forum: General Discussion (https://forum.tyflow.com/forum-2.html)
+--- Thread: TySpline line of sight lasers (/thread-4517.html)



TySpline line of sight lasers - Davers1 - 10-07-2024

Hi All,

I'm working on a project that requires me to show a device that fires lasers to several reflectors on an industrial robot arm. As the arm moves, the lasers track with the reflectors but lose connection when there is no line of sight with the device firing the laser.

   

In the example above, the box is the device firing out the lasers, and the spheres are the reflectors. I want the connection to stay rigid and constant even as the reflectors move. If an object (in this case, a teapot) blocks the line of sight of a reflector to the box, the connection is broken but reconnects once the object has moved out of the way.

As you can see, I've established the initial connection using particles birthed on each sphere, with the box selected as the target in a Find Target node. I'm pretty sure this is not the right way to do it, as the splines remain in their initial position when the spheres are animated (need a Particle Bind maybe?). I also don't have a clue how to create the connection break when another object occludes the direct connection between the two. Hoping someone here might be able to give me a few pointers to help me out!  Big Grin

Thanks,

Andy


RE: TySpline line of sight lasers - d4rk3lf - 10-07-2024

Interesting.

Here is how I solved it.

You just use set target operator, exclude to look at themselves (exclude this event), and use raycast so you brake rays when it's occluded by object(s).
Use spline paths so you can render these target connections.


RE: TySpline line of sight lasers - Davers1 - 10-07-2024

(10-07-2024, 04:46 PM)d4rk3lf Wrote: Interesting.

Here is how I solved it.

You just use set target operator, exclude to look at themselves (exclude this event), and use raycast so you brake rays when it's occluded by object(s).
Use spline paths so you can render these target connections.

Wow, I didn't expect such a fast response!

Thanks so much for having a crack at it and for the example file. I'll take a look and see if I can adapt it to my actual scene.

I'm sure I owe you a lifetime supply of rakija now  Big Grin


RE: TySpline line of sight lasers - d4rk3lf - 10-07-2024

Glad to be of help.

Should be fairly easy to adopt to your scene.
It should work if all 3 stuff are animated (target, particles that look on target, and object that cuts them).

As for rakija.. no worries... my supplies still hold. Big Grin


RE: TySpline line of sight lasers - Davers1 - 10-07-2024

(10-07-2024, 07:27 PM)d4rk3lf Wrote: Glad to be of help.

Should be fairly easy to adopt to your scene.
It should work if all 3 stuff are animated (target, particles that look on target, and object that cuts them).

As for rakija.. no worries... my supplies still hold. Big Grin

I've almost got it working. The only issue I'm having is that the lasers don't move with the reflectors. The particles birthed at the reflectors positions remain in place and don't move with them. The reflector objects are linked to the robot arm and not animated themselves. Could that have something to do with it?

**EDIT** Never mind. I think I've found the issue. I changed the timing in the Position Object node from "On Event Entry" to "Continuous", and it seems to work.


RE: TySpline line of sight lasers - d4rk3lf - 10-07-2024

You can always use "object bind", bellow position object to stick particles to animated surfaces.
By default they will be something like linked to it (pos/rot/scale inherited), but you can switch to surface, if you want them to follow surface.

In my sample I did that for box particle, but didn't for floor.
So for floor it would work if you add object bind bellow position object.. pick the floor.. and the particles will stick to the floor.


RE: TySpline line of sight lasers - Davers1 - 10-07-2024

Thanks. I did try that, but it didn't work the first time. I expect I broke the flow elsewhere when trying to figure out the problem. Luckily, it's a quick one to rebuild, and seems to be working now.

Thanks :-)