Coordinates extraction #230
Replies: 1 comment
-
|
Hi, thank you for your explanation. Yes, depending on the template (Rigid3d or Vec3) of your mechanicalObject in SOFA, there are several ways to get the position in the SOFA or Unity world space. SofaUnity/Core/Scripts/Modules/Controllers/SofaRigidMapper.cs Lines 72 to 90 in 58c9660 More generally in the SofaMesh, the SofaUnity/Core/Scripts/Core/Components/SofaMesh.cs Lines 187 to 191 in 58c9660 Otherwise the SofaMesh creates a unity MeshFilter and you can access its vertices which will be in the Unity coordinate system:. For example: Let me know if this works |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am working with a SOFA scene.scn where a mesh undergoes a rigid translation in 3D space (no deformation), driven by a set of springs.
The scene is loaded in Unity using SofaContext, and the simulation itself runs correctly.
However, I need to retrieve and record the coordinates of this mesh while it is moving, ideally in SOFA coordinates, but Unity coordinates would also be acceptable.
From my observations:
• The Transform values shown in the Unity Inspector are never updated, even though the objects visibly move.
• I cannot find any SofaUnity component or API that exposes the runtime position of an element of the scene.
• This behavior is consistent not only in my own scene, but also in the official SofaUnity demos and tutorials.
Is there a recommended or supported way to access the runtime position (SOFA or Unity coordinates) of an object in a SofaUnity scene.scn?
Thank you in advance for your help.
Beta Was this translation helpful? Give feedback.
All reactions