Game Development Reference
In-Depth Information
7 . Gouraud shading is per-vertex, whereas Phong shading is per-pixel.
Phong shading looks much better on low-poly models because of this, but
it also ends up being more computationally expensive.
8 . The biggest issue with using the painter's algorithm in a 3D scene is that
the process of sorting the scene back to front is time consuming, espe-
cially when given the fact that the camera positions can change dramatic-
ally. It also can potentially cause too much overdraw, which is when a
pixel is drawn over during the process of rendering a frame. Finally, over-
lapping triangles may have to be broken down into smaller triangles for
the painter's algorithm. Z-buffering solves these problems by doing a
depth check at each pixel prior to drawing it—if there is a pixel already
drawn with a closer depth than the current pixel, the current pixel does not
get drawn. This allows the scene to be drawn in an arbitrary order.
9 . Euler rotations only work on the coordinate axes, whereas quaternions can
rotate about any arbitrary axis. Euler angles can also suffer from gimbal
lock, and they are difficult to interpolate between.
10 . Solve for the vector and scalar components:
Chapter 5: Input
1 . A digital device is one that is binary—it can be either in an “on” state or
an “off” state. One example of a digital device is a key on the keyboard.
An analog device, on the other hand, is one that has a range of values. An
example of an analog device is a joystick.
2 . Chords involve pressing multiple buttons at the same time in order to get a
particular action to occur, whereas sequences are a series of button
presses.
3 . Without “just pressed” and “just released” events, button presses will be
detected over the course of multiple frames. For example, if you press the
spacebar quickly, at 60 FPS it is likely the spacebar will be detected as
pressed for several frames, which in turn will trigger the spacebar's action
for multiple consecutive frames. On the other hand, if only “just pressed”
Search WWH ::




Custom Search