- This topic has 2 replies, 2 voices, and was last updated 5 years, 5 months 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 › [SOLVED] Changing object positions after every reset
Tagged: 64_bits, Linux_ubuntu, SOFA_1706
Hello,
I am trying to reinitialize object positions in my scene by changing translation parameter. But the scene gets created in createScene() function and then after reset always starts at the same positions. I want to be able to change positions of object randomly after every reset, any suggestions?
Scene File: link
Thank you,
Rishabh
Hello, Rishabh!
The MechanicalObject class has functions that apply the *initial* transform to an object: applyTranslation and applyRotation. Combined with the various getObject functions from the BaseObject class, you should be able to enumerate all MechanicalObjects in your scene and customize their initial positions before you step the simulation for the first time.
With best regards,
Fabian
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.