Normals in computer graphics serve several essential purposes:
Lighting Calculations: Normals determine how light interacts with a surface, affecting its brightness and shading. Different lighting models use normals to compute diffuse and specular reflections accurately.
Bump Mapping and Displacement Mapping: Normals are employed in bump mapping and displacement mapping to simulate fine surface details without altering the geometry. By perturbing normals, these techniques create the illusion of bumps and deformations
Surface Smoothing: Normals play a role in creating smooth surfaces. In techniques like Gouraud and Phong shading, normals are interpolated across vertices to create the illusion of smooth shading.
Question 2
Caustic Effects on Velvet Surface
Scene: Gemstone on velvet cushion, with a light source.
Phong Model
Only considers local geometry and incoming light direction.
Reflection intensity is not affected by the gemstone.
Velvet surface colors are represented without shadows or caustics.
Whitted Ray Tracing
Velvet surface is approximated as an ideal diffuse surface.
Backward tracing of the ray stops at the surface point.
A shadow ray is created from the point to the light source.
The gemstone occludes the shadow ray, so the point is classified as being in shadow.
Result: Highlighted area is rendered as completely in shadow, without caustics.
Path Tracing
Many rays are shot for every pixel on the cushion surface, following a random walk.
Some rays are refracted within the gemstone and hit the light source.
Aggregating contributions of all random rays simulates complex interactions.
Result: Realistic illumination on the cushion surface, including caustics.
Question 3
Specular Highlight Calculation
Directional light source and reflective ground plane at x=4.
Light source direction: (3,1,6).
Camera location: (b,4,d).
Specular highlight peak at point: (4,2,6).
Reflection direction r=(3,−1,−6).
Reflection direction formula: r=2(n⋅L)n−L, where L is the light direction and n is the normal vector.
Ray from reflection point to the eye: (4,2,6)=(b,4,d)+t(3,−1,−6).
Solve for t using the y-coordinate: t=2.
Substituting t=2 gives:
b=−2
d=18
Question 4
Transformation Matrix Sequence
Transform shape M to shape N.
Origin is at the center of shape M.
Steps
Scale shape M by 2 in the y direction.
Rotate it by 45 degrees around the z-axis.
Translate it with the vector (+2,−2,0).
Matrix
The matrix applied to shape M is then: [1amp;0amp;0amp;20amp;1amp;0amp;−20amp;0amp;1amp;00amp;0amp;0amp;1] [21amp;−21amp;0amp;02−1amp;21amp;0amp;00amp;0amp;1amp;00amp;0amp;0amp;1] [1amp;0amp;0amp;00amp;2amp;0amp;00amp;0amp;1amp;00amp;0amp;0amp;1]
Question 5
Z-buffer and Painter's Algorithm
(a) Z-buffer with Alpha = 1
The Z-buffer handles occlusions by recording the depth of each rendered pixel.
It overwrites the depth if a new, closer surface is rendered on the same location.
Rendering Order
Render the yellow bar.
Render the green bar.
Render the red bar.
(b) Algorithm Choice with Alpha = 0.4
Painter's algorithm is a better choice.
Z-buffer cannot easily deal with translucency, as it requires storing multiple depths in the depth buffer.
Painter's algorithm can render the yellow bar by blending the pixel's color with the previous color using the appropriate alpha instead of overwriting it.