Keyframe hierarchical Animation#
Creating hierarchical keyframes animation in fury
Creating the road
Constructing the car geometry
Adding the the car’s body to an Animation to be able to animate it later.
Creating the wheels of the car
wheel_center = np.array([[0, 0, 0]]) wheel_direction = np.array([[0, 0, 1]]) wheel_positions = [ [1.2, 0, 1.1], [-1.2, 0, 1.1], [1.2, 0, -1.1], [-1.2, 0, -1.1], ] wheels = [actor.cylinder(wheel_center, wheel_direction, (0.1, 0.7, 0.3), radius=1.7, heights=0.3, resolution=10, capped=True) for _ in range(4)]
Animating each wheel and setting its position to the right position using a single keyframe that will not change.
Creating a radar on top of the car
First we create the shaft holding and rotating the radar
In order to animate the shaft actor we have to add it to an Animation
Setting a single position keyframe will make sure the actor will be placed at that position
radar_shaft_anim.set_position(0.0, [0, 2, 0])
Rotating the shaft around Y axis
Now we create the radar itself
Then add it to an animation in order to rotate it
Set position and rotation as done above with the shaft.
Now, we want the radar to rotate when the shaft rotates in hierarchical way. To do that we must add the radar animation as a child animation of the shaft animation as below:
After that we want everything to animate related to the car. The wheels should always be attached to the car no matter where it moves. we do that by adding them as child animations of the car’s body animation
Moving the car
Adding the car Animation to the show manager
Total running time of the script: ( 0 minutes 0.110 seconds)