Obi Official Forum
Curve and Mesh generation with updates - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Curve and Mesh generation with updates (/thread-786.html)



Curve and Mesh generation with updates - micsanbr - 11-12-2018

Hello VM & Forum,

I've created a simple c# script that creates a curve on the fly using a set of positions, using "Obi/Scripts/Utils/ObiRopeHelper.cs" as a reference (great example BTW).

Instead of relying on the solver to update the positions of the curve, inside Update() I'd like to set the "controlPoints" of the "ObiCatmullRomCurve" component and update the mesh of the ObiRope connected to the curve. Is there a way to do this?

Basically I am interested in using the tool only to create procedural tubes / cables / wires meshes, without the physics solver.

Thanks a lot in advance!
-m


RE: Curve and Mesh generation with updates - josemendez - 13-12-2018

(11-12-2018, 01:42 PM)micsanbr Wrote: Hello VM & Forum,

I've created a simple c# script that creates a curve on the fly using a set of positions, using "Obi/Scripts/Utils/ObiRopeHelper.cs" as a reference (great example BTW).

Instead of relying on the solver to update the positions of the curve, inside Update() I'd like to set the "controlPoints" of the "ObiCatmullRomCurve" component and update the mesh of the ObiRope connected to the curve. Is there a way to do this?

Basically I am interested in using the tool only to create procedural tubes / cables / wires meshes, without the physics solver.

Thanks a lot in advance!
-m

Hi there,

The rope mesh is generated from particles, not from curve points. You need the solver particles in order to generate a mesh, so there's no quick way to render a mesh directly from the spline without substantial changes to the code.

There's lots of spline assets on the store that do exactly this, tough.

cheers,


RE: Curve and Mesh generation with updates - micsanbr - 17-12-2018

(13-12-2018, 01:59 PM)josemendez Wrote: Hi there,

The rope mesh is generated from particles, not from curve points. You need the solver particles in order to generate a mesh, so there's no quick way to render a mesh directly from the spline without substantial changes to the code.

There's lots of spline assets on the store that do exactly this, tough.

cheers,

Hello Jose,

Thanks for the fast reply.
Did you check my email message? I've also attached a zip via wetransfer that includes a small example / test case I've hacked together using Obi Rope code and curve components.
What do you think, does it make sense? Am I doing something horribly wrong? Performance-wise it looks decent I think.

Best,
Michele