Graphics Reference
In-Depth Information
14.13 Exercises
Exercise 14.1: Give an example of an arithmetic expression in which the commu-
tativity does not hold for all operations; for example, in which evaluating left-to-
right instead of following the usual order of operations gives an incorrect result.
Exercise 14.2: We said that direct mapping of the range [ 0, 2 b
1, 1 ]
precludes the exact representation of zero. Explain why. (You may find it easiest
to start with the case b = 1.)
Exercise 14.3: Write a function that converts a triangle strip to a triangle list
(a.k.a. triangle soup).
Exercise 14.4: Write a function that converts a triangle fan to a triangle strip.
You may need to introduce degenerate triangles along edges.
Exercise 14.5: Consider a program that represents the world using a 3D array
of opaque voxels; for simplicity, assume that they are either present or not present.
Most rendering APIs use meshes, not voxels, so this program will have to convert
the voxels to faces for rendering. Each filled voxel has six faces. But because the
voxels are opaque, most of the faces in the scene do not need to be rendered—they
are between adjacent filled voxels and can never be seen.
Give an algorithm for iterating through the scene and outputting only the faces
that can be observed.
Exercise 14.6: Draw a computer science tree data structure representing the
scene graph for an automobile, with the nodes labeled as to the parts that they
represent.
Exercise 14.7: Consider a green beer bottle on a white table, in a night club
lit with only red lights (assume each represents a narrow frequency range). What
are the observed colors of the bottle, the table in the bottle's shadow, and the table
out of the bottle's shadow?
Exercise 14.8: Implement disk and sphere Lambertian emitters in the style of
Listing 14.13.
Exercise 14.9: Implement an arbitrary mesh Lambertian emitter in the style
of Listing 14.13.
1 ] to [
 
Search WWH ::




Custom Search