Skip to content

Commit

Permalink
Merge branch 'main' of github.com:USTC-CG/USTC_CG_24
Browse files Browse the repository at this point in the history
  • Loading branch information
zhehaoli1999 committed May 18, 2024
2 parents e56276e + 5d3bc9f commit af3a1f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Homeworks/10_character_animation/documents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ void JointTree::compute_world_transforms_for_each_joint()
最后,mesh顶点位置的更新公式如下:

$$
\~{\mathbf{x}} = \sum_i w_i \mathbf{T}_i * \mathbf{B}_i^{-1} \~{\mathbf{x}}^0
\widetilde{\mathbf{x}} = \sum_i^n w_i \mathbf{T}_i \mathbf{B}_i^{-1} \widetilde{\mathbf{x}}^0
$$

其中 $\mathbf{T}_i$ 和 $\mathbf{B}_i$ 分别为第 $i$ 个关节的 `worldTransform``bindTransform`,
其中 $\mathbf{T}_i$ 和 $\mathbf{B}_i$ 分别为第 $i$ 个关节的 `worldTransform``bindTransform`, $n$ 为对顶点 $\mathbf{x}$ 产生影响的关节数 (需要通过`jointIndices`的长度除以顶点数得到), $\widetilde{\mathbf{x}} = [\vec{\mathbf{x}}, 1] \in \mathbb{R}^{4 \times 1}$ 。

$\~{\mathbf{x}} = [\vec{\mathbf{x}}, 1] \in \mathbb{R}^{4 \times 1}$ , 可以使用`GfMatrix4f::TransformAffine` 函数实现。
这里4x4矩阵对3维向量的变换可以使用`GfMatrix4f`[`TransformAffine`](https://openusd.org/dev/api/class_gf_matrix4f.html#ac379f460c0ef02fddd31ee3dc11f284d:~:text=%E2%97%86-,TransformAffine(),-%5B2/2%5D) 函数实现。

你需要实现[`animator.cpp`](../../../Framework3D/source/nodes/nodes/geometry/character_animation/animator.cpp)中的函数:

Expand Down Expand Up @@ -127,12 +127,12 @@ void Animator::update_mesh_vertices()
1. Adobe的免费动画资源网站[Mixamo](https://www.mixamo.com/),包含角色mesh和多种骨骼动画
2. miHoYo角色MMD资源整理 [链接](https://www.hoyolab.com/article/118389)

> 拓展思考:如果有多个动作顺序播放,考虑一个动作平滑切换到另一个动作,应该怎么在动作之间插值?
> 拓展思考:如果有多个舞蹈动画文件顺序播放,考虑一个动作平滑切换到另一个动作,应该怎么在动作之间插值?
## (Optional) 骨骼动画 + 布料仿真

本次作业我们还有一个选做部分:通过结合骨骼动画与作业8:弹簧质点仿真实现衣服随人体的运动,将在[Part2:骨骼动画+布料仿真](./README-part2.md)中介绍。

## 参考资料 & 扩展阅读材料
1. [GAMES 105:计算机角色动画基础](https://games-105.github.io/)
2. [Game Engine Blog: How I Implemented Skeletal Animation](https://vladh.net/game-engine-skeletal-animation/)
2. [Game Engine Blog: How I Implemented Skeletal Animation](https://vladh.net/game-engine-skeletal-animation/)
2 changes: 1 addition & 1 deletion Homeworks/9_sph_fluid/documents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ for (auto& p : ps_.particles()) {
SPH中密度的计算公式为:

$$
\rho_i = \sum_{j+i} \left(\frac{m_j}{\rho_j} \right) m_j W(\mathbf{x}_ i - \mathbf{x}_ j, h) = \sum_{j+i} m_j W_{ij}
\rho_i = \sum_{j+i} \left(\frac{m_j}{\rho_j} \right) \rho_j W(\mathbf{x}_ i - \mathbf{x}_ j, h) = \sum_{j+i} m_j W_{ij}
$$

这里我们记 $W_{ij} = W(\mathbf{x}_i, \mathbf{x}_j, h)$, $j$ 表示粒子 $i$ 的所有邻居粒子。 在SPH方法中, $h$ 表示核函数半径,我们用 $\Delta t$ 来表示时间步长。
Expand Down

0 comments on commit af3a1f0

Please sign in to comment.