- This topic has 2 replies, 2 voices, and was last updated 5 years ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Programming with SOFA › Tracking target positions inside a deforming body
Tagged: 64_bits, Linux_ubuntu, SOFA_1906
Hi,
I’d like to track the 3D positions of several targets inside a deforming body.
I tried putting sphere meshes inside the body by using MergeVisualModels
to combine the body and sphere meshes.
I thought I could get the positions of spheres later.
It didn’t work so I guess this is not the way to do it.
I suspect that my mapping is wrong but am not quite sure.
Any suggestions please?
(Somehow the post doesn’t show up if I add the code, so I can’t put the code here.)
Thanks!
I hope the code will show up if I put it in the reply.
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')
Dear @bkoo
First of all, I apologize for the delay of my reply. We have been busy with the SOFA Week. You can find out more about this annual community event on SofaFramework’s YouTube account.
I see the problem, but before giving a complete answer could you please explain what you want to do from the position of these points ? do you really need to visualize these tracked spheres?
Best,
Hugo
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.