Deadline: May 20th (Thu) at 15:00pm
We use Python for this assignment. This assigment only supports Python ver. 3.
To check if Python 3.x is installed, launch a command prompt and type python3 --version and see the version.
For MacOS and Ubuntu you have Python installed by default. For Windows, you may need to install the Python by yourself. This document show how to install Python 3.x on Windows.
We want to install dependency locally for this assignment.
cd acg-<username>
python3 -m venv venv # make a virtual environment named "venv"Then, start the virtual environment. For Mac or Linux, type
source venv/bin/activate # start virtual environment For Windows, type
venv\Scripts\activate.bat # start virtual environmentIn the command prompt, you will see (venv) at the beginning of each line.
There will be venv folder under acg-<username>.
In this assignment we use many external library. We use pip to install these.
pip3 install numpy
pip3 install moderngl
pip3 install moderngl_windowAlternatively, you can install above dependency at once by
cd acg-<username>/task08
pip3 install -r requirements.txttype pip3 list and then confirm you have libraries such as moderngl, numpy, pillow, pyglet, pyrr etc.
Follow this document to submit the assignment, In a nutshell, before doing the assignment,
- make sure you synchronized the
mainbranch of your local repository to that of remote repository. - make sure you created branch
task08frommainbranch. - make sure you are currently in the
task08branch (usegit branch -acommand).
Now you are ready to go!
Run the code with python3 main.py
The program will output output.png that update the image below
In this problem, we compute the 3D transformation (rotation and translation) of each bone.
Bones in a skeleton of a character ave a tree structure. Each bone has parent bone, except for the root bone (the bone with index 0).
For bone i_bone, the index of parent bone is self.bone2parentbone[i_bone].
3D Affine transformation from the parent bone is written in bone2relativeTransformation.
Note that index of parent bone is always smaller than the child bone e.g., ibone > bone2relativeTransformation[i_bone].
Write some code around line #??? to compute the transformations of all the bones in bone2globalTransformation.
This will animate the frames (red, blue, and green cylinders) of the bones.
We now have the 3D transformation of each bone, let's animate the mesh using the linear blend skinning.
Write some code around line #??? to implement the linear blend skinning.
Each vertex of the mesh is associated with four bones.
Use inverseBindingMatrix which has the inverse transformation of bone from origin to the undeformed mesh.
This will animate black mesh.
After modify the code, push the code and submit a pull request. Make sure your pull request only contains the files you edited. Good luck!
BTW, You can exit the virtual environment by typing deactivate in the command prompt.

