- This topic has 1 voice and 0 replies.
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Programming with SOFA › Tracking target positions inside a deforming body
Hi,
I’d like to track a few targets (just 3D positions) inside a deforming body.
What I tried was to add sphere meshes in certain positions in the body
and use MergeVisualModels
to merge them with the body.
I thought that I could get the positions of these spheres later.
My code looks like this:
visualNode = body.createChild('visualNode')
bodyObjLoader = visualNode.createObject('MeshObjLoader', name='objLoader',
filename='body.obj')
visualNode.createObject('OglModel', src='@objLoader', name='VisualModel')
pointObjLoader = visualNode.createObject('MeshObjLoader', name='pointObjLoader',
filename='sphere.obj')
visualNode.createObject('OglModel', src='@pointObjLoader',
translation='-81.463 -144.681 -790.974',
name='pointVisualModel')
visualNode.createObject('MergeVisualModels', name='mergedVisualModel',
nb='2', input1='@VisualModel',
input2='@pointVisualModel')
visualNode.createObject('BarycentricMapping', name='visualMapping',
input='@../dofs', output='@VisualModel')
It didn’t work so I guess this is not the way to do it.
I suspect the mapping is causing a problem but am not sure.
Any suggestions on how to do this please?
Thanks a lot!
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.