Introduction to 3D Game Programming with Directx12 Chapter14

(一)、习题答案

1、EXERCISE1

  本题只需要要对控制点进行处理即可,效果一样。

Introduction to 3D Game Programming with Directx12 Chapter14

2、EXERCISE2

  本题需要根据距离对二十面体进行细分。结果如下:

Introduction to 3D Game Programming with Directx12 Chapter14

3、EXERCISE3/4

  习题3与习题4请参阅前文 《Directx12 曲面细分详解》

6、EXERCISE6

  通过设置控制点的值,可以方便的控制生成的曲面的形状,这也是贝塞尔曲线曲面得以大规模应用的最重要一点。

Introduction to 3D Game Programming with Directx12 Chapter14

Introduction to 3D Game Programming with Directx12 Chapter14

Introduction to 3D Game Programming with Directx12 Chapter14

7、EXERCISE7

  使用二次方程的贝塞尔曲面。

Introduction to 3D Game Programming with Directx12 Chapter14

8、EXERCISE8

  本题主要是计算贝塞尔曲面的法向,计算法向的方法是计算函数在du,dv上的偏导数。我们只做了光照,阴影可以采取与第11章的技术。

Introduction to 3D Game Programming with Directx12 Chapter14

9、EXERCISE9

  在本章中例子中,使用的是贝塞尔quad,贝塞尔Triangle还是有一些不一样的地方。贝塞尔Triangle需要使用十个控制点,相应的点的分布及计算公式如下图所示,读者可以在本文参考资料中找到贝塞尔Triangle的原理及细节:

Introduction to 3D Game Programming with Directx12 Chapter14

Introduction to 3D Game Programming with Directx12 Chapter14

  得到的结果如下:
Introduction to 3D Game Programming with Directx12 Chapter14

(二)、参考资料

1、Bézier Triangles and N-Patches Bézier Triangles and N-Patches

(三)、习题源码

1、习题源码 源码下载