Wednesday, 8 June 2011

Swing Animation in 3D-Max Part-3

Swing that moves with 2 bars along

Last project is for creating swing which can move with 2 bars along. In this project I will not use reactor.
Step 1:
Make sure the bar's pivot point located at the top of bar as a hinge.

 Step 2: Link seat object to the bar object with Link tool.
Step 3: Select the bar object.
Step 4: Open Curve Editor Window. You can choose it from Graph Editors Menu.

 Step 5: Select Rotate Y from Rotation part of bar object.


Step 6: Right Click and choose Assign Controller.
Step 7: Select Float Expression from the list and hit Ok.




Step 8: Now Expression controller is open. First need to define a name in Name field. I wrote "swing" as name and then hit

Create button.



Step 9: Hit Assign to Constant button and enter a value such as 10.


Step 10:
Now type the below formula as the Expression:

1.2*cos(swing*F)*exp(-0.009*F)

and then hit the evaluate button.


Now if you look at the Curve Editor you will find a wavy curve that is losing energy by passing time.

Hit the Play button to see the result.

Swing Animation in 3D-Max Part-2

Hanging by Ropes In the next, 
I used a rope instead of chain. The model of rope is just a line go around swing chair.
Step 1: Select the seat object and apply Rigid Body collection to it.

 Hanging by Ropes In the next, I used a rope instead of chain. The model of rope is just a line go around swing chair.

Step 1: Select the seat object and apply Rigid Body collection to it.

 Step 2: Select the Line and in the modifier panel, select reactor Rope modifier. You can also hit reactor Rope modifier

button on Reactor bar while the line is selected.

 Step 3: In reactor Rope parameters, first go to Constraints rollout to define which vertices are fix and which ones need to

attach to the seat. In modifier stack active the Vertex sub-object. Then select the two topmost vertices and hit Fix Vertices

button. These vertices will not move during simulation.


Step 4: Now select the bottom vertices and hit Attach to Rigid Body button.

 Step 5: After this, you need to define your rigid body object in scene. So select Attach to RigidBody from list. The new

rollout will appear with the same name of Attach to RigidBody. Click None button and then pick seat object from scene. Now

the bottom vertices that you selected them are attach to seat object.

 Step 6: In properties rollout of reactor Rope modifier, you need to set parameters for your swing. The Mass of line object

will be set in here. You can define thickness of your rope in Thickness field. In the friction field you can specify how

smoothly the rope move relative to surfaces it's in contact with. Air Resistance is related to speed of simulation. It will

cause rope loses energy as it moves.
We have two rope types that for this project we need to use Constraint because it will not stretch rope.
Step 7: Our rope modifier will not work without Rope Collection. So Create a Rope Collection and add your line object to it.

Step 8: Final setting will be for seat object. Select it and increase its Mass. in this example I increase it to 5.
Step 9: Simulation is ready. You can hit Create Animation on the Reactor bar to create animation or choose Preview Animation

to watch realtime.