Connecting two models with a cable... how to?

I am dealing with the following situation:

I use two boxes, that represent connectors. Now I want to draw a cable, that connects both connectors. What would be the easiest approach to connect both models and how to create a cable, that somewhat looks like cable.



next step would be to find a way, where to put the cable, so it doesn't intersect with any other objects.

But really any advice on the first question first…

a few options:

  • a simple Line (does no look perspectively correct) - see TestLine
  • a TrailMesh - see TestTrailMesh
  • a long Box or Cylinder





    Do you want the cable to react physically? (could be hard i guess)

So it has to avoid interesecting with any other objects… Like this?



(Blue is the cable)

just came across the Bezier Curve… I guess, that could be a promising option? defining the vectors, where both connectors are located at and a third point in order to bend the bezier curve, seems kind a practical approach… gotta check that.

I would have to bend a long box or cylinder… I don't know if that is possible.



@Momoko_Fan:

exactly…! If I could do that using a bezier curve, that would be awesome!

in order to define the path for the connection you would need some path finding like the a* algorithm…

i've built a connection framework for 2d schematics using a* and drawn using java 2d…

it's pretty straight forward…

pm me if you want some more info…