• News

• Industries

• Learning & Support

• Community

• Marketplace

Ideas for creating dynamic duct tape?

Hiya,

I’m working on a VR game where the player can build/construct items/weapons. When the player attaches 2 pieces together, I’d like to add duct tape dynamically.
I did some R&D, and the closest thing is using the Spline tool to cover the bounds. Still no idea on how to implement it, but seems like an idea.

What are your thoughts on how I can achieve this? (Please see image)

If it’s not that many configurations, it’d be much much easier to pre-make those meshes.

There will be a lot of combinations. I’m mostly thinking about the cylinder taped to the iron at the back. It could be a thicker piece of iron, or it could be a thinner gas cylinder.

When you say pre-make, you mean model the gas cylinder with the duct tape, and when the player attaches it, just reveal/spawn that piece?
It does give an idea… maybe I can model the tape piece/pieces, then spawn the correct one based on which combination the player happens to put together.

I mean the tape pieces, have a number of them that you could switch out depending on the configuration. Also, if you can, try and make it a part of one of the other meshes, so maybe that canister has the tape mesh as a part of that mesh, rather than having the tape mesh as a separate mesh so that it reduces the number of draw calls. At least if it’s simple enough in terms of the number of combinations.

Perhaps you could spawn in a circle of points in an array with a diameter slightly larger than the object you are taping. The number of points is equal to how many vertices are in your spline. With each point, trace towards the center of the circle, and if it hits the mesh then you set the point’s position to that location.

After you iterate through each point, find out which points are concave (going inwards) relative to the two points around it. For each point that is concave, you move the point (using its angle with the two points around it) until the three points form a straight line. This creates those duct tape “bridges” over gaps such as the ones between the fuel tank and the pipe in your screenshot.
EDIT: Oh yea, some concave areas may consist of multiple points, so your implementation of “unconcaving” your points should handle this possibility.

Once that is done, just create your duct tape spline using those points.

Since this is really only going to be done once per duct tape created, it shouldn’t be performance-heavy either. Obviously, more points means better looking tape.
It’s a bit complicated for just creating tape, but it’s the most dynamic implementation off the top of my head. I believe this should work.