I want to add LED strips to objects at runtime. The led strip is a very simple rectangular mesh that is generated at runtime. A shader then just draws LEDs down the length of the strip.
My first thought was to raycast each vertex (of the LED strip mesh) towards the target mesh. But as expected this will not work to wrap around the front of the object.
Another problem with this way is that if the LED vertices are further apart, a section of the LED strip will clip through the object.
I am starting to think the only way to do this is to use the Object's vertex data to build a mesh that conforms to it exactly. This is pretty easy in blender using the knife tool. Unfortunately I have no idea how to approach this with code.
What I am trying to achieve here:
Players have a flying wing drone, they can place decals at runtime to customize their plane. This works okay so far, but when it turns into night, I would like LEDS on the plane, so its easier to see. At the moment these LED strips are meshes, so the player cannot customize it at all.
I would like to start with a blank wing. Then be able to add a LED strip (user can set the length on the go) and then lay it down on the surface of the wing like you can place a decal. This is fairly simple until the path of the strip goes around a bend.
Since decals are projected and cannot make 90 degree turns, my idea was to generate the strip as a mesh at runtime. Then to "walk" the vertices over the model using raycasts. Basically shrink-wrap the strip to the model's mesh. Quickly learned its not a simple process at all.