Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stretch and relax rope problem
#1
Hi, 

I want to make a rope passing through some set of points, let's say, p1, p2, p3, p4. 
but I want its original length is |p1-p2|. I want rope is full stretched and tight when rope end point is at p4.
I setup rope on edit mode, and when I play, rope passes through my desired points.

My desire is when rope is released from p4 it must be relaxed and gets to its original length of |p1-p2|.

When I setup control points to make rope pass through all points, when it is released it keeps its length |p1-p2| + |p2-p3| + |p3-p4|. Hoverer I want it length to be |p1-p2|

How can I achieve this?
Reply
#2
(16-03-2023, 05:54 PM)berko Wrote: Hi, 

I want to make a rope passing through some set of points, let's say, p1, p2, p3, p4. 
but I want its original length is |p1-p2|. I want rope is full stretched and tight when rope end point is at p4.
I setup rope on edit mode, and when I play, rope passes through my desired points.

My desire is when rope is released from p4 it must be relaxed and gets to its original length of |p1-p2|.

When I setup control points to make rope pass through all points, when it is released it keeps its length |p1-p2| + |p2-p3| + |p3-p4|. Hoverer I want it length to be |p1-p2|

How can I achieve this?

Hi there,

The rope's "stretching scale" parameter is a multiplier on the distance in-between particles. So if you set it to 0.7, overall rope rest length gets reduced to 70%. You can take advantage of this to reduce the length of your rope at startup so that it matches |p1-p2|. To do this, set its value to the ratio between its original rest length and |p1-p2|. Note this doesn't add or remove particles from your rope, it just scales the distance between particles.

kind regards,
Reply
#3
(17-03-2023, 08:07 AM)josemendez Wrote: Hi there,

The rope's "stretching scale" parameter is a multiplier on the distance in-between particles. So if you set it to 0.7, overall rope rest length gets reduced to 70%. You can take advantage of this to reduce the length of your rope at startup so that it matches |p1-p2|. To do this, set its value to the ratio between its original rest length and |p1-p2|. Note this doesn't add or remove particles from your rope, it just scales the distance between particles.

kind regards,
Thanks Jose, you respond very quickly, great support

I would like to access rope spline, to follow path? How can access rope spline?
Reply
#4
(17-03-2023, 04:22 PM)berko Wrote: Thanks Jose, you respond very quickly, great support

I would like to access rope spline, to follow path? How can access rope spline?

Hi!

The spline you edit in the path editor is only used to set up the initial rope parameters (length, shape, thickness, etc). It is not used at runtime at all.

At runtime, ropes are made of particles and constraints like all other Obi actors. If you want an object positioned at a specific point in the rope at runtime, you can get an orthonormal frame at any given point in the rope using ObiPathSmoother. GetSectionAt(float mu), passing a floating point value between 0 (start of the rope) and 1 (end of the rope).

The returned struct contains position, normal and binormal vectors, among other info (see the API docs).

kind regards,
Reply