-
Hi, In the example animated_body.py, time_step_callback() was used to make the dragon spin. I have a series of .obj files which contain the motion sequence of a rigid body. Can I make it animate by using time_step_callback(), too? I tried to delete and add boundary models in the function, but I got confused with the classes and functions of pysph. Is it workable? If so, how could I achieve that? Thanks!! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I think it is not the best way to remove and add boundary models since things have to be initialized in the right order. Depending on the boundary handling you use, you have different options. If you use Akinci boundary handling, you could update the positions and velocities of all boundary particles in the script. For the other methods you need a position and rotation matrix of the boundary model. For the position you could compute the center of mass in each frame and move the boundary model. Extracting the rotation is a bit more complex but this can be done using shape matching (https://cg.informatik.uni-freiburg.de/publications/2005_SIGGRAPH_deformationShapeMatching.pdf). Btw. our position-basd dynamics library contains an implementation of shape mathcing (https://github.com/InteractiveComputerGraphics/PositionBasedDynamics/blob/136469f03f7869666d907ea8d27872b098715f4a/PositionBasedDynamics/PositionBasedDynamics.cpp#L501). Hope that helps! |
Beta Was this translation helpful? Give feedback.
I think it is not the best way to remove and add boundary models since things have to be initialized in the right order. Depending on the boundary handling you use, you have different options. If you use Akinci boundary handling, you could update the positions and velocities of all boundary particles in the script. For the other methods you need a position and rotation matrix of the boundary model. For the position you could compute the center of mass in each frame and move the boundary model. Extracting the rotation is a bit more complex but this can be done using shape matching (https://cg.informatik.uni-freiburg.de/publications/2005_SIGGRAPH_deformationShapeMatching.pdf). Btw. our posi…