Skip to content

Commit

Permalink
2.ex03、第2章完成、第3章开始
Browse files Browse the repository at this point in the history
  • Loading branch information
kanition committed May 25, 2021
1 parent 021dd87 commit 547e841
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 8 deletions.
Binary file added Pictures/chap03/killeroo-control-684x1368.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Pictures/chap03/killeroo-control.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions content/chap02.tex
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,4 @@ \chapter{几何与变换}\label{chap:几何与变换}

\input{content/chap02ex02.tex}

\input{content/chap02ex03.tex}

{\noindent\hfil$=========$\hfil{\color{red}{施工分割线}}\hfil$=========$\
\input{content/chap02ex03.tex}
7 changes: 4 additions & 3 deletions content/chap0209.tex
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ \subsection{定界移动边界框}\label{sub:定界移动边界框}

一旦我们把区间缩窄到运动导函数的区间值覆盖到零,
实现就切换到牛顿法的一些迭代从区间中点开始求取零点。
牛顿法\sidenote{译者注:指牛顿迭代法。}需要函数导数;因为我们要求运动导函数的零点,
牛顿法\sidenote{译者注:详见笔者在\refsec{译者补充:牛顿迭代法}补充的牛顿迭代法相关内容。}需要函数导数;因为我们要求运动导函数的零点,
所以需要\refeq{2.11}的二阶导数:
\begin{align*}
\frac{\mathrm{d}^2a_{\bm M,\bm p}(t)_x}{\mathrm{d}t^2}=(c_{3,x}+2\theta(c_{4,x}+c_{5,x}t))\cos(2\theta t)+(c_{5,x}-2\theta(c_{2,x}+c_{3,x}))\sin(2\theta t)\, .
Expand All @@ -888,7 +888,8 @@ \subsection{定界移动边界框}\label{sub:定界移动边界框}
(*zeroCount)++;
\end{lstlisting}

注意当使用牛顿法时如果函数在{\ttfamily tInterval}内有多个零点,
则我们这里只会找出其中一个。
注意使用牛顿法时如果函数在{\ttfamily tInterval}内有多个零点,
则我们这里只会找出其中一个
\sidenote{译者注:牛顿法有相应的收敛条件,详见\refsec{译者补充:牛顿迭代法}。}。
然而,因为该点处的区间非常小,这类错误的影响也很小。
无论如何,我们在实际中还没有发现这个问题造成过麻烦。
4 changes: 2 additions & 2 deletions content/chap02ex03.tex
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ \subsection{简单迭代法}\label{sub:简单迭代法}
\item 对于任意$x_0\in[a,b]$,迭代公\refeq{02ex0307}收敛,且\begin{align}\label{eq:02ex0308}
\lim\limits_{k\rightarrow\infty}{x_k}=x^*\, ;
\end{align}
\item 迭代公\refeq{02ex0307}的后验和先验误差估计式分别为
\item 对于$k=1,2,\cdots$迭代公\refeq{02ex0307}的后验和先验误差估计式分别为
\begin{align}
|x_k-x^*| & \le\frac{L}{1-L}|x_k-x_{k-1}|\, , \label{eq:02ex0309} \\
|x_k-x^*| & \le\frac{L^k}{1-L}|x_1-x_0|\, ;\label{eq:02ex0310}
Expand Down Expand Up @@ -136,7 +136,7 @@ \subsection{简单迭代法}\label{sub:简单迭代法}
\end{align}
从而
\begin{align}\label{eq:02ex0317}
|x_k-x^*|\le\frac{1}{1-L}|x_{k+1}-x_k|\, .
|x_k-x^*|\le\frac{1}{1-L}|x_{k+1}-x_k|,\quad k=0,1,\cdots\, .
\end{align}
又因为根据拉格朗日中值定理有
\begin{align}\label{eq:02ex0318}
Expand Down
17 changes: 17 additions & 0 deletions content/chap03.tex
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
\chapterimage{Pictures/chap03/killeroo-control-684x1368.png}
\chapter{形状}\label{chap:形状}

本章中,我们将阐述pbrt对例如球体和三角形等几何图元的抽象。
光线追踪器中对几何形状的仔细抽象是干净系统设计的关键部分,
而且形状是面向对象方法的理想选择。
所有几何图元都实现一个公共接口,
渲染器剩余部分可以使用该接口而无需底层形状的任何细节。
这样能分离pbrt的几何与着色系统。

pbrt将图元的细节隐藏在两层抽象后。
\refvar{Shape}{}提供对图元原始几何属性的访问,
例如其表面面积和边界框,并且提供光线交点例程。
\refvar{Primitive}{}封装了关于图元的额外非几何信息,例如其材质属性。
然后渲染器剩余部分只处理\refvar{Primitive}{}抽象接口。
本章将关注只与几何相关的类\refvar{Shape}{};
\refvar{Primitive}{}接口是第\refchap{图元和交点加速}的关键内容。

\input{content/chap0301.tex}

{\noindent\hfil$=========$\hfil{\color{red}{施工分割线}}\hfil$=========$\
\input{content/chap0309.tex}
6 changes: 6 additions & 0 deletions content/chap0301.tex
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
\section{基本形状接口}\label{sec:基本形状接口}

\refvar{Shape}{}的接口定义于
源文件\href{https://github.com/mmp/pbrt-v3/tree/master/src/core/shape.h}{\ttfamily core/shape.h}中,
\href{https://github.com/mmp/pbrt-v3/tree/master/src/core/shape.cpp}{\ttfamily core/shape.cpp}中
可以找到\refvar{Shape}{}公共方法的定义。
基类\refvar{Shape}{}定义了通用形状接口。
它也暴露了一些对所有\refvar{Shape}{}实现有用的公有数据成员。
\begin{lstlisting}
`\initcode{Shape Declarations}{=}`
class `\initvar{Shape}{}` {
Expand Down

0 comments on commit 547e841

Please sign in to comment.