C307 Lab-4 Modeling and Animation
Submission Deadline: Feb 10, 2023
Exercise 1
Install and Run the MoCap player for visualizing .asf and .mcp files. Open the .asf & .amc files with any word processor (e.g., wordpad). Answer the following questions: a. How many bones are there in the .asf file “dance.asf?” b. Draw the Hierarchical Tree for the bones for the “dance.asf” file. c. How many motion frames are there in the “dance.amc” file? d. How many motion frames are there in the “run.amc” file? Submit your answers as .pdf file on eclass.
Exercise 2
Write code in matlab to achieve the rotation for each body part. The sample code for left arm is provided. The skeleton code is also provided as below. You are not allowed to change the code in Section1. Submit your answers as .mlx on eclass.
% Section1: build skeleton
head = [0, 0; 0, 7];
neck = [0, 0; 0, 2];
left_upper_arm = [0, -5; 0, 0];
left_forearm = [-5, -7; 0, 2];
left_hand = [-7, -8; 2, 3];
right_upper_arm = [0, 5; 0, 0];
right_forearm = [5, 7; 0, 2];
right_hand = [7, 8; 2, 3];
body = [0, 0; 0, -5];
left_thigh = [0, -2; -5, -7];
left_lower_leg = [-2, -3; -7, -10];
left_feet = [-3, -4; -10, -11];
right_thigh = [0, 2; -5, -7];
right_lower_leg = [2, 3; -7, -10];
right_feet = [3, 4; -10, -11];
skeleton = {head, neck, left_upper_arm, left_forearm, left_hand,
right_upper_arm, right_forearm, right_hand, body, left_thigh,
left_lower_leg, left_feet, right_thigh, right_lower_leg, right_feet};
• In Section 2, you should write code to rotate the left upper arm, left forearm and left hand. Each part should allow a changeable rotation angle. Hardcoding for coordinates is not allowed. Plot the result in one figure for this section.
• In Section 3, you should write code to rotate the right upper arm, right forearm and right hand. Each part should allow a changeable rotation angle. Hardcoding for coordinates is not allowed. Plot the result in one figure for this section.
• In Section 4, you should write code to rotate the body and update the related body parts. Hardcoding for coordinates is not allowed. Plot the result in one figure for this section.
• In Section 5, you should write code to rotate the left thigh, left lower leg and left feet. Each part should allow a changeable rotation angle. Hardcoding for coordinates is not allowed. Plot the result in one figure for this section.
• In Section 6, you should write code to rotate the right thigh, right lower leg and right feet. Each part should allow a changeable rotation angle. Hardcoding for coordinates is not allowed. Plot the result in one figure for this section.
• In Section 7, you should write code to rotate the head and neck. Each part should allow a changeable rotation angle. Hardcoding for coordinates is not allowed. Plot the result in one figure for this section.