Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Obi Rope Pipe Water Flow Effect
#5
(27-01-2022, 01:44 PM)josemendez Wrote: You can make the sine wave relative to rope length, instead of relative to particle index. This way when particles separate due to stretching, the bulge won't stretch with them.

Simply accumulate the distance from one particle to the next, and use that instead of "i" in "Mathf.Sin(i + time)".

cheers,

Actually I didn't understand what do you mean exactly. I tried the code below and it didn't work.


Code:
float distance = Vector3.Distance(obiRope.GetParticlePosition(solverIndex), obiRope.GetParticlePosition(solverIndex - 1));
solver.principalRadii[solverIndex] = Vector3.one * (baseThickness + Mathf.Max(0, Mathf.Sin(distance + time) * bumpThickness));
Reply


Messages In This Thread
Obi Rope Pipe Water Flow Effect - by NorkQ - 27-01-2022, 11:16 AM
RE: Obi Rope Pipe Water Flow Effect - by NorkQ - 27-01-2022, 01:40 PM
RE: Obi Rope Pipe Water Flow Effect - by NorkQ - 27-01-2022, 02:08 PM
RE: Obi Rope Pipe Water Flow Effect - by NorkQ - 27-01-2022, 04:57 PM