Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Curve and Mesh generation with updates
#1
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
Reply
#2
(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,
Reply
#3
(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
Reply