Institutionen för teknisk databehandling, Bo Nordin (bosse@cb.uu.se, 018-183470), 961216

Tentamen i Datorgrafik MN1/DV1 961217
Examination, Computer Graphics MN1/DV1 961217


Tid och plats: 09.00-14.00, Polacksbacken

Inga hjälpmedel förutom papper, penna, suddgummi och ordböcker tillåtna. Skriv namn på alla papper du lämnar in. Använd ej rödpenna. Skriv endast på ena sidan av varje papper.

För godkänt krävs 18 p, för väl godkänt 28 poäng (av totalt 40). Lösningsförslag kommer att finnas tillgängliga på kursens hemsida från ca kl 15.00 961217. Resultat meddelas via e-post och anslå på TDB senast 961220.

Time and Place: 09.00-14.00, Polacksbacken

Only paper, pen(cil), erasers, and dictionaries allowed. Enter your name on all papers you hand in. Do not use red ink. Write on only one side of each paper.

18 points are required to pass the exam, 28 points is required to pass with distinction ("väl godkänt"). The total number of points is 40. Suggested solutions to the exam will be available in the homepage of the course from 15.00 961217. The result will be sent by e-mail and posted at TDB no later than 961220.


1. CRT-monitorn / The CRT Monitor (2p)

a) Varför måste en skärm av CRT-typ uppdateras många gånger i sekunden?
b) De två orden interlaced och non-interlaced dyker ibland upp när man pratar om uppdatering av CRT-skärmar. Vad betyder de?

a) Why is it necessary to refresh a CRT monitor several times per second?
b) The two words interlaced and non-interlaced occur frequently in discussions about the refresh rate of CRT monitors. What do they mean?

2. Skrivmod / Write Mode (2p)

När man skriver i rasterminnet (frame buffer) kan man låta det man skriver vara en operation mellan det som skrivs och det som finns i buffern före skrivningen.

a) Vid så kallad gummibandning (rubberbanding) används ofta en sådan operation. Vilken?
b) Hur kan man använda liknande teknik för att åstadkomma transparens om ett material släpper igenom n % av ljuset?

When pixels are written in the frame buffer, it is possible to execute a logical operation between the written pixel and the previous contents of the frame buffer.

a) Rubber banding techniques often use one of these operations ? Which one?
b) How can a similar technique be employed to accomplish transparency if a transparent material transmits n % of the light?

3. Om interaktion / About Interaction (3p)

Antag att du skall implementera de två interaktionerna nedan i ett fönstersystem. Beskriv kortfattat hur du skulle göra samt ange i vilken mod (eller vilka moder) interaktionen görs. Du kan anta att du har tillgång till ett toolkit på Motif's nivå.

a) Användaren skall ge textsträng som behövs för att programmet skall kunna fortsätta.
b) Rita en rektangel av godtycklig storlek i ett fönster.

Assume you are requested to implement the two interactions below in a windowing system. Briefly describe how you would do this and state in which input mode (or modes) the interaction is done. You can assume that you have access to a toolkit like Motif.

a) The user must enter a text string that is required for the program to continue.
b) Draw a rectangle of arbitrary size in a window.

4. 2D-transformationer / 2D Transformations (4p)

2D-objektet i figur a) nedan skall transformeras till positionen i figur b).Hur åstadkommer man detta? Vilka steg behövs? Ge transformationsmatriser, dels för alla steg, dels också den sammanlagda. Det finns två principiellt olika sätt att åstadkomma transformationen. Beskriv båda, du behöver ge matriserna bara för det ena fallet.

The 2D object in figure a) below is to be transformed to its position in figure b). How is this accomplished? What steps are needed? Show the transformation matrices for each step, and also for the complete transformation. There are two fundamentally different ways to do the transformation. Describe both; matrices are required for only one of the two cases.

5. Färgteori / Colour Theory (4p)

Inom färgteori pratar man om dominerande våglängd, renhet och luminans (eller intensitet). Figuren nedan visar spektrum för en färg. Ge, med hjälp av beteckningarna i figuren, ett uttryck för vart och ett av de tre begreppen. Ungefär vilka värden bör W2 och W3 ha för att figuren skall visa rött? Hur skall figuren ändras för att visa en renare röd?

Dominant wavelength, purity, and luminance are three important concepts in colour theory. The figure below shows the spectrum of a colour. Using the terms in the figure, give an expression for each of the three concepts. Approximately what values should W2 and W3 have to make the figure display red? How should the figure be altered to display a purer red?

6. Attribut i X / Attributes in X (2p)

Hur hanteras attribut i X? Jämför med PHIGS! Varför har man valt denna modell i X?

How are attributes handled i X? Compare with PHIGS! Why was this scheme chosen in X?

7. Borttagning av trappstegseffekter / Antialiasing (4p)

a) När man ritar raka linjer på på en terminal för rastergrafik uppstår s.k. trappstegseffekter (aliasing). Vad är de och vad beror de på?
b) Två metoder för att komma till rätta med trappstegseffekter baseras på ytsampling (area sampling): oviktad och viktad. Beskriv kortfattat dessa.

a) When you draw straight lines on a raster graphics terminal aliasing effects will occur. What are they and why do they occur?
b) Two algorithms for antialiasing are based on area sampling: unweighted and weighted. Briefly describe these.

8. Cirkelgenerering / Generation of circles (4p)

Vid visning av primitiver på enheter för rastergrafik görs en rastrering (scan conversion). Vad innebär detta och varför behövs den? Vid ritning av en cirkel kan man använda formeln x2 + y2 = R2 (där R är radien) genom att lösa ut y och loopa över x. Detta fungerar dock inte så bra. Vad händer? Diskutera förbättringar av algoritmen och beskriv en algoritm för effektiv rastrering av cirklar.

In order to be able to display primitives on raster graphics workstations, a scan conversion must be done. What does scan conversion mean and why is it necessary. When drawing a circle, one can use the formula x2 + y2 = R2 (where R is the radius of the circle) by solving for y and then loop over x. However, this does not work very well. What happens? Discuss possible improvements of the algorithm and describe and algorithm for efficient scan conversion of circles.

9. 3D-grafik / 3D viewing (5p)

a) För att specififera en 3D-vy används två koordinatsystem: världskoordinater och VRC-systemet. Hur specificeras VRC utifrån världskoordinatsystemet? Hur, och i vilket system, specificeras fönstret?

b) Hur specificeras betraktarens position? I vilket system? Vilken är skillnaden mellan parallellprojektion och perspektivprojektion när det gäller betraktningsposition?

c) Vad behös mer för att vi skall erhålla en "vy-volym" (view volume)?

a) In order to specify a 3D view, two coordinate systems are used: the world coordinate system and the VRC system. How is the VRC system specified in the world coordinate system? How, and in which system, is the view window specified?

b) How is the view position specified? In which system? What is the difference between parallel and perspective projection with regard to viewing position?

c) What more is needed to produce a view volume?

10. Bézier-kurvor / Bézier curves (3p)

Hur används de fyra kontrollpunkterna i Bézier-kurvor? Rita ett exempel på en Bézier-kurva, både själva kurvan och kontrollpunkterna. Exemplet skall visa de olika kontrollpunkternas roll. Vilken roll spelar det konvexa höljet för kurvan? Visa det konvexa höljet i ditt exempel.

How do the four control points control a Bézier curve? Draw a Bézier curve, the curve itself as well as the four control points. The drawing must show the role of the control points. What is the importance of the convex hull? Show the convex hull in your sketch.

11. Ljus / Illumination (3p)

Givet följande förenklade belysningsmodell:

I = Iaka + fattIp(kdcos(alpha) + kscosn(beta))

En sfär med radien 2 har sitt centrum i punkten (0,0,-2). En punktformig ljuskälla är placerad i (5,5,10). Antag att sfären har reflektionskoefficienterna 0.4 för bakgrundsljus , 0.8 för diffus reflektion av riktat ljus och 0.7 för blank reflektion av riktat ljus. Bakgrundsljuset har en intensitet av 3, punkljusets intensitet är 2 och sfärens blankhetstal (specular reflection exponent) är 40.

Ge ett uttryck för den upplevda ljusstyrkan (pixelvärdet) för en betraktare i punkten (4,8,10) som tittar mot sfärens yta i punkten (0,0,0). Låt det riktade ljusets intensitet vara direkt omvänt proportionell mot avståndet till ljuskällan.

OBS! Du behöver inte räkna fram pixelvärdet, bara visa hur det räknas fram utifrån siffrorna i exemplet.

Given the following simplified lighting model:

I = Iaka + fattIp(kdcos(alpha) + kscosn(beta))

A sphere with radius 2 is centred at (0,0,-2). A point light source is positioned at (5,5,10) Assume that the reflection coefficients for the sphere are 0.4 for ambient light, 0.8 for diffuse light, and 0.7 for specular reflection. The intensity of the ambient light is 3, the intensity of the point light is 2, and the specular reflection exponent of the sphere is 40.

Give an expression for the perceived brightness (pixel value) for a viewer at (4,8,10) looking towards the surface of the sphere at (0,0,0). Assume that the intensity of the point light is inversely proportional to the distance to the light source.

NOTE: You do not have to calculate the pixel value, only show how it can be calculated from the figures in the example.

12. Volymvisualisering / Volume Visualisation (2p)

Volymer kan visas antingen med volume rendering eller surface rendering. Beskriv kortfattat de två metoderna. Ange speciellt skillnaden i datarepresentation.

Volume visualisation algorithms use either volume rendering or surface rendering. Briefly describe the two methods. In particular, what is the difference in how data is represented?

13. JPEG/MPEG-komprimering / JPEG/MPEG compression (2p)

Beskriv kortfattat stegen i JPEG-komprimering av bilder. Tala speciellt om vad det är som gör att JPEG-komprimerade bilder normalt inte kan återskapas exakt.

Briefly describe the steps in JPEG compression of images. What in the compression scheme makes JPEG compression a "lossy" compression (i.e. it is not possible to recreate the image exactly as it looked)?