大家好~本课程为“真实感渲染”的线上课程,从0开始,介绍相关的图形学算法和数学基础,给出详细的数学推导、伪代码和实现代码,最终带领大家开发出基于物理的渲染器


【资料图】

线上课程资料:

本节课录像回放

加QQ群,获得ppt等资料,与群主交流讨论:106047770

本系列文章为线上课程的复盘,每上完一节课就会同步发布对应的文章

本课程系列文章可进入索引查看:真实感渲染系列文章索引

目录

回顾相关课程

为什么要学习本课

主问题:什么是2D变换

推导过程如下图所示:

通过变换(1,0)点,可以得到矩阵的A、C值:

同理,通过变换(0,1)点,可以得到矩阵的B、D值

\[\begin{bmatrix}x" \\y"\end{bmatrix} = \begin{bmatrix}x \\y\end{bmatrix} + \begin{bmatrix}t_x \\t_y\end{bmatrix} \]

主问题:什么是齐次坐标

为什么要引入“齐次坐标”

\[\begin{bmatrix}x" \\y" \\1\end{bmatrix} = \begin{bmatrix}1 & 0 & t_x \\0 & 1 & t_y \\0 & 0 & 1\\\end{bmatrix} \begin{bmatrix}x \\y \\1\end{bmatrix} =\begin{bmatrix}x + t_x \\y + t_y \\1\end{bmatrix} \]

主问题:更多的2D变换有哪些

变换的顺序对结果有影响!

这里应该使用先旋转再位移,表达式为:

主问题:什么是3D变换

\[\begin{bmatrix}x" \\y" \\z" \\\end{bmatrix} = \begin{bmatrix}a & b& c \\d & e& f \\g & h& i \\\end{bmatrix} \begin{bmatrix}x \\y \\z \\\end{bmatrix} + \begin{bmatrix}t_x \\t_y \\t_z \\\end{bmatrix} \]\[\begin{bmatrix}x" \\y" \\z" \\1\\\end{bmatrix} = \begin{bmatrix}a & b& c & t_x \\d & e& f & t_y \\g & h& i & t_z \\0 & 0 & 0 & 1 \\\end{bmatrix} \begin{bmatrix}x \\y \\z \\1\\\end{bmatrix} \]

总结

参考资料

扩展阅读

推荐内容