Help Match object orientation with a rope section (or particle) - 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 Match object orientation with a rope section (or particle) (/thread-3977.html) |
Match object orientation with a rope section (or particle) - Alberos - 21-08-2023 Hi, I'm trying to create a 3D ring around the specific point of the rope. So far I have been able to set the position correctly using ObiPathSmoother.GetSectionAt() and some TransformPoint(). However, I couldn't get the orientation right. The ObiPathFrame given to me from ObiPathSmoother.GetSectionAt() do have main axis data (normal, binormal, and tangent), however, they seem to not align with the section orientation. It sometimes align sometimes don't (I Debug.DrawRay all 3 values and they're not align). Am I missing something here? I'm using rope, so I think I can't use the orientation of the particle itself as I thought rope don't simulate particle orientation? Here's the code for setting both position and rotation. Code: ObiPathFrame section = mainRopePath.GetSectionAt(normalizeRopePoseOf62CM); Thanks RE: Match object orientation with a rope section (or particle) - josemendez - 22-08-2023 (21-08-2023, 12:04 PM)Alberos Wrote: Hi, Hi! the frames returned by GetSectionAt() are used to build the rope mesh every frame, so they must match the rope. Your code correctly transforms the frame position from actor to world space, however it doesn't do the same with rotation. So unless your rope transform is exactly at 0,0,0, with zero rotation, the rotation value will be completely wrong. Here's the fixed code: Code: var trfm = smoother.transform; (21-08-2023, 12:04 PM)Alberos Wrote: I'm using rope, so I think I can't use the orientation of the particle itself as I thought rope don't simulate particle orientation? Correct, rope particles don't have any orientation information. The frames returned by GetSectionAt() are built using parallel transport, that is: an orthonormal frame is "transported" along the path defined by particle positions, aligned to the path's tangent while trying to minimize rotation. This gives an accurate estimate for 2 out of all 3 axis, but the third one (torsion along the rope) is essentially random. kind regards, RE: Match object orientation with a rope section (or particle) - Alberos - 22-08-2023 Hi, as always, thanks for the quick respond. I have edited my code using your reply and it working perfectly now, thanks! |