Tutorial: Double Pendulum
Open Blender. In Linux type: "blender -w". When blender opens you will see a cube outlined in pink. The pink highlighting indicates it has been selected. Type "g" which means grab. Moving the mouse will move the cube. Move it where ever. If you type, x, y, or z you can move the cube in the global x, y, or z direction. If you type xx or yy or zz you can move it in the local x, y or z direction. Type "r" and rotate the cube. The position and orientation of the cube is immaterial. You can position the cube as shown below.
Make sure that you are in object mode, rather than edit mode. The menu bar just below the cube should say "Object Mode". Edit mode is for editing an object and the example requires the creation of another object. Pressing tab will switch from edit to object mode or visa versa.
Press the space bar. You will see a menu, select Add and then UVSphere and ok to the number of segments and the number of rings. After this step you will be in "edit" mode. If you select "g" in this mode you will just move the mesh and not the empty which defines the center (empties will be explained further later). Select tab and make sure you are in "object mode". Use "g" to grab the sphere and move it away from the origin. Again it doesn't matter exactly where the cube and the sphere are. You might place them similar to the picture below.
Now we need to place two empties. First select near the origin, this will move the cursor close to the origin. Now press <Shift> s and Cursor->Grid. Select view side and press <Shift> s and Cursor->Grid. The cursor should now be at 0,0,0. Press space bar and Add empty. Now the empty is selected. Hit r, x, then 90 and enter. This will rotate the empty 90 degrees about the x-axis. Hold down the shift key and right click on the cube. Now that both the empty and the cube are pink select <Ctrl> p and Make Parent. This will make the Cube the parent of the empty. Make another empty by hitting the space bar, add empty. Put it somewhere in between the cube and the sphere and make the sphere the parent of the second empty. Again, this is accomplished by selecting the empty with the right mouse, holding shift and right selecting the sphere and selecting Make Parent.
Now we will connect the cube and the sphere using the empties to locate and orient the joint. Select script from the left corner of the menu below the cube and sphere and is circled in the picture below and to the left.
Select the newly created Scripts button and Misc and Mbdyn Joint as shown above and to the right. Fill in the blanks to make it look like the picture below. Blender will indicate that the name has been changed to remove the . that appears in the name automatically. MBDyn does not allow these periods.
again change it to match the picture below.
You have made two joints and are ready to solve and watch your double pendulum fall under gravity, to do that, go to the script menu, export and select MBDyn. Then fill in the blanks as shown below and to the right. Only the end time is changed from it's default. Hit "Start Solve", the MBDyn input file will be written and MBDyn started.
Note: In the export formfill you can save a file which contains the MBDyn informaion to import later. The MBDyn data does not get saved with the blender file.
Now import the results. Scripts, import, MBDyn Import. Use an import rate of 10. That will import 1 of every ten frames produced, which is enough in this case. Hit the "Import File" button to import the results.
To play the results click on the snake icon to change the lower menu to IPO curve editor. Then select Play Animation in 3D view. You can also drag the green line in the lower menu to scroll forward and back. To stop the animation hit <ESC>
Thats it.