diff --git a/README.md b/README.md
index f0696ba..752ea13 100644
--- a/README.md
+++ b/README.md
@@ -82,36 +82,25 @@ PT算法:
物体的漫反射系数$diffusionRate$、镜面反射系数$specularRate$、折射系数$refractRate$满足:
-$$
-diffusionRate + specularRate + refractRate = 1
-$$
+
+
对于某一条相机视线ray来说,撞击到物体也相应地将后续光线分为3部分:
(1) 漫反射,在ray撞击物体点的法向半球(即上表面)随机选择一个方向反射
(2) 镜面反射,根据公式:
-$$
-ReflectDir = Lx – (2 * Lx·N)*N
-$$
+
+
计算出反射光线的方向
(3) 透射,根据折射定律计算出折射方向
-$$
-\frac {sin \theta_1} {sin \theta_2} = \frac {n_2} {n_1}
-$$
-其中,若同时具有镜面反射与折射,则采用轮盘赌的形式决定反射与折射的选择
-
-$$
-\begin{aligned}
-finalColor \ += \ & diffusionRate * objectColor * computePathTracing(diffuseDirection) + \\
+
- & specularRate * objectColor * computePathTracing(reflectDirection) + \\
+其中,若同时具有镜面反射与折射,则采用轮盘赌的形式决定反射与折射的选择
- & refractRate* objectColor * computePathTracing(refractDirection)
-\end{aligned}
-$$
+
主要实现在PathTracing.h和PathTracing.cpp中,也包括其余的各类object求交函数intersect等
@@ -164,27 +153,16 @@ $$
球的uv坐标计算为:
-$$
-\begin{aligned}
-\phi &= atan2(z,x) \\
-\theta &= asin(y) \\
-u &= 1- \frac {\phi + \pi} {2\pi} \\
-v &= \frac {\theta + \pi / 2}{\pi}
-\end{aligned}
-$$
+
+
见sphere.hpp的getTextureColor函数,line72-79
Bezier曲面的贴图uv坐标计算为:
-$$
-\begin{aligned}
-u &= \frac {\theta}{2\pi} \\
-v &= u_{bezier}
-\end{aligned}
-$$
-
+
+
贴图的图片与解释详见上文
@@ -206,54 +184,19 @@ $$
若记xy平面内的2Dbezier参数曲线坐标与射线点坐标分别为:
-$$
-P(u) =
-\begin{bmatrix}
-P_x(u) \\
-P_y(u) \\
-0
-\end{bmatrix}
-$$
-
-$$
-L(t)=rayOrigin+t*rayDirection =
-\begin{bmatrix}
-rayO_x + t*rayD_x \\
-rayO_y + t*rayD_y \\
-rayO_z + t*rayD_z \\
-\end{bmatrix}
-$$
+
绕z轴旋转$\theta$角,则曲线旋转后的点坐标为:
-$$
-S(u,\theta) =
-\begin{bmatrix}
-P_x(u)cos\theta \\
-P_y(u) \\
--P_x(u)sin\theta
-\end{bmatrix}
-$$
+
+
记函数:
-$$
-F(t,u,\theta) = L(t) - S(u,\theta)
-$$
+
+
+
则:
-$$
-\frac {\partial F(t,u,\theta)} {\partial (t,u,\theta)} =
-\begin{bmatrix}
-rayD_x & -P'_x(u)cos\theta & P_x(u)sin\theta \\
-rayD_y & -P'_y(u) & 0 \\
-rayD_z & P_x(u)sin\theta & P_x(u)cos\theta \\
-\end{bmatrix}
-$$
-
-$$
-x(t,u,\theta) =
-x(t,u,\theta) -
-{\frac {\partial F(t,u,\theta)} {\partial (t,u,\theta)}}^{-1} *
-F(t,u,\theta)
-$$
+
+
最终效果如下(采样率很低的单物体图片,仅作对比使用):
diff --git a/pictures/formula1.png b/pictures/formula1.png
new file mode 100644
index 0000000..9d148cd
Binary files /dev/null and b/pictures/formula1.png differ
diff --git a/pictures/formula10.png b/pictures/formula10.png
new file mode 100644
index 0000000..93c61f2
Binary files /dev/null and b/pictures/formula10.png differ
diff --git a/pictures/formula2.png b/pictures/formula2.png
new file mode 100644
index 0000000..d11fe49
Binary files /dev/null and b/pictures/formula2.png differ
diff --git a/pictures/formula3.png b/pictures/formula3.png
new file mode 100644
index 0000000..c5ff734
Binary files /dev/null and b/pictures/formula3.png differ
diff --git a/pictures/formula4.png b/pictures/formula4.png
new file mode 100644
index 0000000..d676bc9
Binary files /dev/null and b/pictures/formula4.png differ
diff --git a/pictures/formula5.png b/pictures/formula5.png
new file mode 100644
index 0000000..2f27e25
Binary files /dev/null and b/pictures/formula5.png differ
diff --git a/pictures/formula6.png b/pictures/formula6.png
new file mode 100644
index 0000000..62df33a
Binary files /dev/null and b/pictures/formula6.png differ
diff --git a/pictures/formula7.png b/pictures/formula7.png
new file mode 100644
index 0000000..534bed2
Binary files /dev/null and b/pictures/formula7.png differ
diff --git a/pictures/formula8.png b/pictures/formula8.png
new file mode 100644
index 0000000..dd2540f
Binary files /dev/null and b/pictures/formula8.png differ
diff --git a/pictures/formula9.png b/pictures/formula9.png
new file mode 100644
index 0000000..3e9b910
Binary files /dev/null and b/pictures/formula9.png differ