Week 8 Tutorial
Question 1
The normal at a point on a surface is (0,4,5). The direction to the light source is (0,0,1). The diffuse colour of the light is (0.2, 0.7, 0.9). The kd of the surface is (0.4,0,1). What colour will the point be?
Question 2
A polygon has four vertices A B C D = (-1,0,0), (0,-1,0), (1,0,0), (0,1,0). It has a kd of (0.5,0.5,0.5), ks of (0.9, 0.9, 0.9), and a phong exponent of 5. Assume that ka is the same as kd
There is a light source with intensity (0.8,0.8,0.8) at position (5,5,5). Ambient light is (0.2,0.2,0.2).
Our eye is at (5,0,10).
(a) What is the centre of the polygon?
(b) What is the normal to the polygon? Normalised?
(c) What is the vector to the light source from the centre of the polygon? What about from the vertex D? Normalised?
(d) What is the vector to the viewer from the centre of the polygon? What about from the vertex D? Normalised?
(e) What is the total intensity of the polygon due to ambient and diffuse components at the centre of the polygon and at the vertex D?
(f) What is the reflected vector of the light source at the centre and at vertex D?
(g) What is the the contribution of specular reflection at the centre? What about at D?
(h) What is the final colour of the centre and D?
(i) Does using flat shading make a difference compared to applying the illumination equation at each point in this case?
(j) For which of the following eye positions would the polygon be back face culled?
- (5,0,10) (where we start off).
- (0,0,10)
- (0,0,-10)
- (5,0,0)
Question 3
Find the equation of the plane in which the triangle (-1,1,1) (-4,2,1) (4,1,0) lies. (Hint: use a cross product to find a normal to this plane.) If this triangle has red green and blue coefficients of diffuse reflection of (0.9,0.2,0.5), and is illuminated by two lights, one of colour (1.0,0,0.2) positioned at (201,201,201), and one of colour (0.5,0.2,0) at position (201,101,1), what colour should the triangle be shaded if (a) we only shade one side of the polygon - the one facing the light source or (b) we shade both sides of a polygon? The triangle is not at all shiny (no specular reflection). Ignore light source attentuation with distance.
Question 4
Consider the following situation:
- We have a triangle whose corners are at (0,1,0), (-1,0,0), (1,0,0). The normals we are given at each corner are
,
and
. These come from the surface we are trying to model. - The triangle is relatively small compared to the light source and the distance to the viewer.
- The triangle is grey, with a kd of 0.3 and a ks of 0.7. Its phong exponent is 20.
- The vector to the light source is (0,0,1). The light source has an intensity of 0.8. Ignore light source attenuation.
- The vector to the viewer is also (0,0,1). (In other words, the viewer is wearing a headlight).
(a) Work out the intensity of each of the corners using the Phong illumination model.
(b) Does the specularity have any effect for the corners?
(c) Consider the middle of the bottom edge the triangle now (i.e. (0, 0, 0)). What would the intensity of the middle be if we used Gouraud shading?
(d) If we were using normal interpolation (i.e. Phong shading), what would the interpolated normal at the middle of the bottom edge be?
(e) Using normal interpolation, what should the intensity at (0,0,0) be?