Code: Select all
% Create the Right Hand Sphere
rightHandSphere = Body();
rightHandSphere.setName('RightHandSphere');
rightHandSphere.setMass(0.3);
rightHandSphere.setInertia(Inertia(0,0,0,0,0,0));
% Add Visible Object for GUI
rightHandSphere.addDisplayGeometry(strcat('sphere.vtp'));
rightHandSphere.getDisplayer().setScaleFactors([0.1, 0.1, 0.1]);
Code: Select all
rightHandSphere = Body();
rightHandSphere.setName('RightHandSphere');
rightHandSphere.setMass(0.3);
rightHandSphere.setInertia(Inertia(0,0,0,0,0,0));
% Add Visible Object for GUI
rightHandSphere.attachGeometry(Mesh(strcat('sphere.vtp')));
rightHandSphere.upd_scale_factors().set_scale_factors([0.1, 0.1, 0.1]);
Mesh sphere.vtp not connected to model..ignoring
Undefined function 'upd_scale_factors' for input arguments of type 'org.opensim.modeling.Body'
Please let me know how to specify the .vtp/.stl/.obj file and scale factor for a newly defined body to be displayed as a visible object in the GUI.
Regards,
Sanchana