计算机图形的照明和阴影

时间:2014-06-02 04:31:14

标签: interpolation phong pixel-shading

我明天准备考试,这是练习题之一。我部分地解决了它,但我和其他人混淆了。问题出在这里:考虑一个没有环境光和镜面光的灰色世界(只有漫射光)。三角形P1,P2,P3的屏幕坐标是P1 =(100,100),P2 =(300,150),P3 =(200,200)。 P!,P2,P3的灰度值分别为1 / 2,3 / 4和1/4。光线处于无限远,其方向和灰色分别为(1,1,1)和1.0。漫反射系数是1/2。 P1,P2,P3的法线分别为N1 =(0,0,1),N2 =(1,0,0)和N3 =(0,1,0)。考虑三个点P1,P2,P3的坐标为0.不规范化法线。我已经计算出3个顶点P1,P2,P3处的照度是(1 / 4,3 / 8,1 / 8)。我还计算了坐标为(220,160)的三角形内的点P的插值系数由(1 / 5,2 / 5,2 / 5)给出。现在我还有4个关于这个问题的问题。

1) The illumination at P using Gouraud Shading is: 
   i) 1/2 
   The answer is 1/2, but I have no idea how to compute it..
2) The interpolated normal at P is given by
   i) (2/5, 2/5,1/5)
   ii) (1/2, 1/4, 1/4)
   iii) (3/5, 1/5, 1/5)
3) The interpolated color at P is given by:
   i) 1/2
   Again, I know the correct answer but no idea how to solve it
4) The illumination at P using Phong Shading is
   i) 1/4
   ii) 9/40
   iii) 1/2

0 个答案:

没有答案