Obi Official Forum
Help Obi Rope path tracking - 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: Help Obi Rope path tracking (/thread-3670.html)



Obi Rope path tracking - RuralSculpture - 29-11-2022

I want to follow the path of the rope and move the characters, how can I do that?
Can we detect rope positions step by step?

[Image: JaZhKx.png]


RE: Obi Rope path tracking - josemendez - 29-11-2022

Hi,

Not entirely sure what you mean by "detect rope positions step by step", but I guess you mean getting particle positions in the rope? If so, you can do so by iterating trough the rope elements, getting the positions of particles using the particle API:
http://obi.virtualmethodstudio.com/manual/6.3/scriptingropes.html
http://obi.virtualmethodstudio.com/manual/6.3/scriptingparticles.html

kind regards,


RE: Obi Rope path tracking - RuralSculpture - 29-11-2022

Hi,

Thanks for the reply,

I want the character to move like the black line attached to the rope taking the positions I'm working on Obi's the sample scene right now.

[Image: Jabv6R.png]


RE: Obi Rope path tracking - josemendez - 29-11-2022

Then it may be simpler to get  an orthonormal frame from the rope, which you can do by calling ObiPathSmoother's GetSectionAt(float mu) method. Given a normalized coordinate in the (0,1) range, it will return an orthonormal frame in the rope (containing position, normal, tangent, binormal).

Code:
var frame = rope.GetComponent<ObiPathSmoother>().GetSectionAt(0.5); // get frame at the middle of the rope.



RE: Obi Rope path tracking - RuralSculpture - 29-11-2022

(29-11-2022, 10:27 AM)josemendez Wrote: Then it may be simpler to get  an orthonormal frame from the rope, which you can do by calling ObiPathSmoother's GetSectionAt(float mu) method. Given a normalized coordinate in the (0,1) range, it will return an orthonormal frame in the rope (containing position, normal, tangent, binormal).

Code:
var frame = rope.GetComponent<ObiPathSmoother>().GetSectionAt(0.5); // get frame at the middle of the rope.
it was very good i edited it as i wanted thank you so much