Some Math Concept:
Solid Angle
定义:
$$
\Omega(\bold{p}) = \iint_\mathcal{S}\sin(\phi)\mathrm{d}\theta\mathrm{d}\phi
$$
可直观理解为将
对于三角形面的数值计算:
Let a = vi − p, b = vj − p, c = vk − p and a = ‖a‖, b = ‖b‖, c = ‖c‖ $$ \tan\left(\dfrac{\Omega(\bold{p})}{2}\right) = \frac{\det([\bold{a}, \bold{b}, \bold{c}])}{abc + (\bold{a}\cdot \bold{b})c + (\bold{b}\cdot \bold{c})a+(\bold{c}\cdot \bold{a})b} $$ Some Related Work:
Jacobson, Alec, Ladislav Kavan, and Olga Sorkine-Hornung. “Robust Inside-Outside Segmentation Using Generalized Winding Numbers.” ACM Transactions on Graphics 32, no. 4 (July 21, 2013): 1–12. https://doi.org/10.1145/2461912.2461916.
Jacobson, Gavin Barill, Neil Dickson, Ryan Schmidt, David I. W. Levin, Alec. “Fast Winding Numbers for Soups and Clouds.” Accessed September 27, 2022. https://www.dgp.toronto.edu/projects/fast-winding-numbers/.
Some Learning Notes:
实际处理时的特殊情况:
当
由于 C 语言中 atan2 函数的返回定义域为
- If
yis±0andxis negative or-0,±πis returned - If
yis±0andxis positive or+0,±0is returned