【COMP5823M】Dungeon 1: The Charming Choreographer (Inverse Kinematics, 33g of total 100g). 1g may be exchanged
for a human percentage point in COMP5823M.
For the birthday celebration of Lord Spinhead, the Great Dancer Lady Anklesprainer is the master
choreographer. She has been designing a glorious but difficult dance show. After breaking some ankles,
she decides to use simulated characters to try some of her moves.
You, my loyal geniuses, will provide your assistance. You will build an Inverse Kinematics system to
animate human characters. It should come with a GUI which can load/save BVH files. It should be able to
play an animation clip from the BVH file and allow the user to control the positions of the joints by dragging.
For your hard work, Lady Anklesprainer has kindly agreed to give you rewards for:
- A GUI to load and play the BVH files in 3D. (5g)
- The same GUI to write BVH files. This should write an animation clip into a BVH file. (6g)
- A basic Inverse Kinematics (with pseudo-inverse) system which can handle positional constraints
for any single joint to update a posture (e.g. drag the right wrist and use IK to update the whole
body from the root). (7g) - A basic Inverse Kinematics (with pseudo-inverse) system which can handle positional constraints
for all combinations of joints to update a posture (e.g. position both hands and the neck
simultaneously to reach given target positions). (7g) - A damped Inverse Kinematics system that can accomplish 3 and 4. (4g)
- An Inverse Kinematics implementation with control on joints (refer to the slides for ‘Adding
control’ to IK). (4g)
The total reward is 5g + 6g + 7g + 7g + 4g + 4g = 33g.
Hint 1: There are several places in town where you can find assistance. (You can find the specs of BVH
files at https://research.cs.wisc.edu/... and some sample
code and BVH files in Minerva under Lab Resources)
Hint 2: You can use other BVH software to help you debug and test your system (BVH player
https://sites.google.com/a/cg..., BVH hacker http://www.bvhacker.com/)
The whole submission needs to be implemented in Visual Studio C++. It should be your own work
except for any third-party libraries. Make sure that you submit a zip file containing the whole Visual
Studio solution. You are free to use third-party libraries for GUI, rendering, triangulation, videocapture
and linear algebra operations, etc. But IT SHOULD BE STANDALONE SO THAT I CAN RUN IT ON
MY WINDOWS COMPUTER.
Some further hints below:
A human body skeleton can be represented as follow:
We already know that each joint includes an offset and a rotation (refer to the BVH file). We can stack all
the rotations (joint angles) into a long vector. If you have 25 joints in the skeleton and each has three
rotational angles, you can stack them into a 75x1 vector. Let’s call this vector θ. Now assuming that you
want to control the 3D position of one joint, e.g the right hand. Its position can be represented by a 3x1
vector Y = [px, py, pz]. Assume that the current position of the right hand is c and the joint angles are θ1.
The target position of the right hand is t and the IK aims to compute new joint angles θ2 so that the right
hand will be at t, by t – c = J (θ2 – θ1). Here both t and c are 3x1 vectors, and θ1 and θ2 are both 75x1
vectors. Naturally, the Jacobian matrix J is a 3x75 matrix. The only unknown here is θ2. t, c and θ1 are
known. We still need to compute J, by computing each entry of it. Let’s take a look at the structure of J:
To compute an entry, we look at one example . It can be computed by:
???
??? ≈
???
??? =
?????
???
Assuming θ1 is your root joint angle indicating its rotation around the x-axis, this entry essentially means
if the root rotates around the x-axis by a small amount say ?θ1 = 0.001, the x coordinate of right hand
will change from p1 to p2 . So the only unknown here is p2. One way to compute it is to change θ1 by ?θ1 ,
then do Forward Kinematics once to compute p2. You should already know how to do Forward
Kinematics (You already used it when you render the BVH file. Look at the code I shared for labs.).
Now we know how to compute the Jacobian J. The rest is the specific IK schemes you want to
implement for task 3-6. One change about controlling more than one joint is that Y is not a 3x1 vector
anymore. If you want to control two joints regarding their 3D positions only, Y will be a 6x1 vector. If you
want to control both the orientation and position of one joint, Y will also be a 6x1 vector.
推荐阅读
- 人工智能|干货!人体姿态估计与运动预测
- 分析COMP122 The Caesar Cipher
- 技术|为参加2021年蓝桥杯Java软件开发大学B组细心整理常见基础知识、搜索和常用算法解析例题(持续更新...)
- C语言学习(bit)|16.C语言进阶——深度剖析数据在内存中的存储
- Python机器学习基础与进阶|Python机器学习--集成学习算法--XGBoost算法
- 数据结构与算法|【算法】力扣第 266场周赛
- 数据结构和算法|LeetCode 的正确使用方式
- leetcode|今天开始记录自己的力扣之路
- 人工智能|【机器学习】深度盘点(详细介绍 Python 中的 7 种交叉验证方法!)
- 网络|简单聊聊压缩网络