---
title: "Gouraud intensity at midpoint P"
subject: "Computer Graphics"
chapter: 8
key: "semester_5/computer_graphics:gouraud-intensity-midpoint-scan-line"
source: https://www.bctengineer.com/q/semester_5/computer_graphics/gouraud-intensity-midpoint-scan-line
site: BCT Engineering
---

# Gouraud intensity at midpoint P

Computer Graphics · Chapter 8: Illumination and Surface Rendering methods

- Asked in: 2074 Asoj, 12 marks
- Video: [Polygon Rendering   Constant shading , Gouraud Shading , Phong Shading](https://www.youtube.com/watch?v=VrPHSuy5BWM) — Ekeeda
- Page: https://www.bctengineer.com/q/semester_5/computer_graphics/gouraud-intensity-midpoint-scan-line
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_graphics/chapter-8

## Question

[Figure: a rectangle/triangle scene with vertices (1,10,1), (10,10,1), (1,5,0), (1,1,-1), (10,1,1); scan line y = 3 meets the polygon edges at points a and b, with P the midpoint of ab.] Find out the intensity of light reflected from the midpoint P on scan line y = 3 in the above given figure using Gouraud shading model. Consider a single point light source located at positive infinity on Z-axis and assume vector to the eye as (1,1,1). Given d = 0, K = 1, Ia = 1, IL = 10, Ks = 2, Ka = Kd = 0.8 for use in a simple illumination model.

## Short answer

Assuming the polygon is a flat surface with unit normal (-0.1037, -0.1098, 0.9885), the vertex intensity computed is 14.85. Since all vertex intensities are equal, Gouraud interpolation yields intensity 14.85 at the midpoint P.

## Answer

**Assumptions.** The figure gives no vertex normals, so the polygon is treated as one flat surface and all vertices use its unit normal. The polygon (1,10,1), (10,10,1), (10,1,1), (1,1,−1), (1,5,0) is only approximately planar; its best-fit normal (from Newell's method) is (17, 18, −162), and the side facing the light is taken, N = (−17, −18, 162)/|…| = (−0.1037, −0.1098, 0.9885). The specular exponent is not given, so n = 1 is assumed.

Light: point source at +∞ on the z-axis, so L = (0, 0, 1). Eye: V = (1,1,1)/√3 = (0.5774, 0.5774, 0.5774). With d = 0 and K = 1, the attenuation factor is 1/(d + K) = 1.

**Model:** I = Ka·Ia + [IL/(d + K)] · [ Kd (N·L) + Ks (R·V)^n ]

**Step 1: dot products**
- N·L = 0.9885
- R = 2(N·L)N − L = (−0.2051, −0.2172, 0.9544)
- R·V = 0.5774·(−0.2051 − 0.2172 + 0.9544) = 0.3072

**Step 2: vertex intensity** (same for all vertices)
- Ambient: Ka·Ia = 0.8·1 = 0.8
- Diffuse: 10 · 0.8 · 0.9885 = 7.908
- Specular: 10 · 2 · 0.3072 = 6.144
- I = 0.8 + 7.908 + 6.144 = **14.85**

**Step 3: scan line y = 3**
The line crosses the edge (1,5,0)–(1,1,−1) at a and the edge (10,10,1)–(10,1,1) at b.
- a = (1, 3, −0.5)
- b = (10, 3, 1)
- Midpoint P = (5.5, 3, 0.25)

Edge interpolation (linear in y), with the end-point intensities all equal to 14.85:
- I_a = ((3 − 1)/(5 − 1))·14.85 + ((5 − 3)/(5 − 1))·14.85 = 14.85
- I_b = 14.85 (both ends of the right edge have intensity 14.85)

Scan-line interpolation at the midpoint P (x_p halfway between x_a = 1 and x_b = 10):
I_P = ((x_b − x_p)/(x_b − x_a))·I_a + ((x_p − x_a)/(x_b − x_a))·I_b = 0.5·14.85 + 0.5·14.85

**Answer: I_P ≈ 14.85** under these assumptions. If different vertex normals were given, the vertex intensities would differ, and the same two interpolation steps would apply (the midpoint value is then (I_a + I_b)/2).

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What are the main steps of Gouraud shading for a point on a scan line?
   A. Interpolate normals along edges, then compute intensity at each pixel
   B. Find vertex intensities, interpolate along edges to the scan-line ends, then interpolate across the scan line
   C. Compute one intensity for the polygon and fill it
   D. Compute intensity only at the midpoint with no interpolation
   Answer: B. Gouraud interpolates intensity linearly along edges and then along the scan line. (Key point: Method steps)

2. For a source at positive infinity on the Z-axis, what is L?
   A. L = (1, 1, 1)
   B. L = (0, 0, -1)
   C. L = (0, 0, 1)
   D. L = (1, 0, 0)
   Answer: C. The source is in the +z direction, so the unit vector toward it is (0,0,1). (Key point: Light and eye vectors)

3. If the intensities at a and b are equal, what is the intensity at the midpoint P?
   A. Half of that value
   B. Twice that value
   C. The value at vertex (1,10,1) only
   D. Equal to that same value, since it is a 50/50 weighted average
   Answer: D. I_P = 0.5*I_a + 0.5*I_b, which equals the common value, 14.85 here. (Key point: Interpolation at midpoint)

4. What intensity does the answer find at P?
   A. About 14.85
   B. About 7.9
   C. About 0.8
   D. About 6.1
   Answer: A. Ambient 0.8 + diffuse 7.908 + specular 6.144 = 14.85, the same at all vertices. (Key point: Result)

## Related in Computer Graphics

- [Gouraud shading for polygon rendering](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Agouraud-shading-intensity-interpolation) — Computer Graphics, chapter 8, asked 6×
- [Intensity at centroid of a triangle](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Atotal-intensity-triangle-centroid) — Computer Graphics, chapter 8
- [Compare Gouraud and Phong shading](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Acompare-gouraud-phong) — Computer Graphics, chapter 8, asked 7×
- [Flat (constant intensity) shading](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Aflat-shading-accurate-condition) — Computer Graphics, chapter 8, asked 2×
- [Polygon table and normal of S1](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Apolygon-table-surface-normal-s1) — Computer Graphics, chapter 6
- [Polygon tables to model Dharahara](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Apolygon-vertex-edge-table-dharahara) — Computer Graphics, chapter 6

## Related in other subjects

- [Thin film interference by reflected light](https://www.bctengineer.com/question.md?key=semester_1%2Fengineering_physics%3Athin-film-reflected-interference-theory) — Engineering Physics, chapter 4, asked 2×
- [Single point ground above 1 MHz](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Asingle-point-ground-high-freq) — Instrumentation II, chapter 6
- [Area of triangle and rectangle program](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Aarea-triangle-rectangle-overload) — Object Oriented Programming, chapter 3
- [A3 curve meets critical depth line normally](https://www.bctengineer.com/question.md?key=semester_4%2Fhydraulics%3Aa3-curve-meets-critical-line-normally) — Hydraulics, chapter 8
