Starting from:

$25

CSE4020 - Computer Graphics - Lab Assignment 10 - Solved

1. Write down a Python program to calculate end point and velocity of 2-joint arm, using forward kinematics.

A.     Set the window title to your student ID and the window size to (640, 640)

B.     Start from LabAssigment10-code-skeleton.py.

i.         When program begin, you can see white boxes(2 joint arm) on x axis.

ii.        You can rotate these boxes by changing matrix R1 and R2. iii.       R1 and R2 should be calculated by XYZ Euler Angles.

              iv.          

C. You should rotate 2 joints, by changing rotation matrix R1 and R2.

i.         The joint R1 should be t rad rotated by Y axis when t seconds have elapsed since the program was executed. (Rotation angle for X, Z axis is 0)

ii.        The joint R2 should be t rad rotated by X axis and t rad rotated by Z axis when t seconds have elapsed since the program was executed. (Rotation angle for Y axis is 0) D. You should mark end point of arm, with some lines or little box.

                i.  End SRLQWLVFHQWHURIVHFRQGMRLQWĜVRXWHUSODQH

E.      You should draw line for showing velocity of end point.

i.            The velocity vector can be calculated between current end point and before end point.  

ii.           Multiply 10 to the length of line(magnitude of velocity vector) for visible.  

iii.         The velocity vector is started at current end point and direction is to next frame.

F.      Expected result: Uploaded LabAssignment10-1.mp4

i.            7RFRPSDUH\RXUUHVXOWZLWKYLGHRURWDWHFDPHUDE\SUHVVNH\ěĜ, 4 times.


 

2. Write down a Python program to show animation of 2-joint arm, using interpolation of rotation matrix.

A. Set the window title to your student ID and the window size to (640, 640) B. Start from LabAssignment10-code-skeleton.py. It is same as lab assignment 10-1.

C.     You should make 61 frames animation(0 ~ 60).

D.     Frame 0, Frame 20, Frame 40, Frame60 was given. You can calculate R1 and R2 to draw each frame. Make inner frames using interpolation method(Slerp) that you implemented at LabAssignment9.

Frame 
Rotation(XYZ Euler Angle, degree) 
0
(R1: X 20 Y 30 Z 30) (R2: X 15 Y 30 Z 25)  
20
(R1: X 45 Y 60 Z 40) (R2: X 25 Y 40 Z 40)  
40
(R1: X 60 Y 70 Z 50) (R2: X 40 Y 60 Z 50)  
60
(R1: X 80 Y 85 Z 70) (R2: X 55 Y 80 Z 65)  
 

E.      Use red color for 0 frame, yellow color for 20 frame, green color for 40 frame, blue color for 60 frame and white color for all inner frames.

F.      Expected result: Uploaded LabAssignment10-2.mp4

                i.  7RFRPSDUH\RXUUHVXOWZLWKYLGHRURWDWHFDPHUDE\SUHVVNH\ěĜtimes. 

More products