COS3712 EXAM PACK
2024
QUESTIONS AND
ANSWERS
FOR ASSISTANCE CONTACT
EMAIL:
, lOMoARcPSD|31863004
2 COS340-A
October/November 2009
QUESTION 1 [10]
a) OpenGL uses z-buffering for hidden surface removal. Explain how the z-buffer algorithm
and give one advantage of using this method. (5)
Answer:
OpenGL uses a hidden-surface method called z-buffering
that saves depth information into an extra
buffer which is used as objects are rendered so that parts of objects that are behind other ob
appear in the image. The z-buffer records the depth or the distance from the Thus,
COPas of a pixel.
polygons are scan-converted in random order, the algorithm checks the z-value of the pixel
coordinates (in the frame buffer) that it is trying to draw to. If the existing pixel at these coo
(i.e. if there already was a pixel) has a z-value further from the viewer than the pixel we are
draw, then the colour and depth of the existing pixel are updated, otherwise it continues wit
to the colour buffer or the depth buffer.
Advantages:(1 mark for either answer)
easy to implement in either software or hardware
it is compatible with pipeline architectures - can execute at the same speed at which vertice
b) Orthogonal, oblique and axonometric view scenes are all parallel view scenes. Define th
parallel view and explain the differences between orthogonal, axonometric, and oblique
scenes. (5)
Answer:
Parallel views - views with the COP at infinity.
Orthogonal views - projectors are perpendicular to the projection plane and projection plane
to one of the principal faces of an object. A single orthogonal view is restricted to one princi
of an object.
Axonometric view - projectors are perpendicular to the projection plane but projection plane
any orientation with respect to object.
Oblique projection - projectors are parallel but can make an arbitrary angle to the projection
and projection plane can have any orientation with respect to object.
[TURN OVER]
, lOMoARcPSD|31863004
3 COS340-A
October/November 2009
QUESTION 2 [8]
a) Define the term homogeneous coordinates and explain why they are used in computer
Answer:
Homogeneous coordinates are four dimensional column matrices used to represent both po
vectors in three dimensions.
When points and vectors are represented using 3-dimensional colum
matrices one cannot distinguish between a point and a vector, with homogeneous coordinat
can make this distinction.
marks can be awarded for any of the points mentioned below:
A matrix multiplication in 3-dimensions cannot represent a change in frames, while this can
using homogeneous coordinates.
All affine transformations can be represented as matrix multiplications in homogeneous coo
Less arithmetic work is involved when using homogeneous coordinates.
The uniform representation of all affine transformations makes carrying out successive tran
far easier than in 3 dimensional space.
Modern hardware implements homogeneous coordinates operations directly, using paralleli
achieve high speed calculations.
b) Consider the line segment with endpoints a and b at (1, 2, 3) and (2, 1, 0) respectively.
the coordinates of vertices a and b that result after an anticlockwise rotation by 15 abo
axis.(Show your workings) (4)
Hint: The transformation matrix for rotation around the z-axis is
(where θ is the angle of anticlockwise rotation).
[TURN OVER]
Downloaded by Gabriel Musyoka ()
, lOMoARcPSD|31863004
4 COS340-A
October/November 2009
Then, to rotate a' and b' by 15 about the z-axis, we use the rotation matrix
Similarly
So a'' = (0.448, 2.191, 3)
and b'' = (1.673, 1.484, 0) (4)
QUESTION 3 [8]
OpenGL is a pipeline model. In a typical OpenGL application, a vertex will go through a seque
transformations or change of frames. In each frame the vertex has different coordinates.
a) Name these coordinates in the order that they occur in the OpenGL vertex transformation
[5]
[TURN OVER]
Downloaded by Gabriel Musyoka ()
2024
QUESTIONS AND
ANSWERS
FOR ASSISTANCE CONTACT
EMAIL:
, lOMoARcPSD|31863004
2 COS340-A
October/November 2009
QUESTION 1 [10]
a) OpenGL uses z-buffering for hidden surface removal. Explain how the z-buffer algorithm
and give one advantage of using this method. (5)
Answer:
OpenGL uses a hidden-surface method called z-buffering
that saves depth information into an extra
buffer which is used as objects are rendered so that parts of objects that are behind other ob
appear in the image. The z-buffer records the depth or the distance from the Thus,
COPas of a pixel.
polygons are scan-converted in random order, the algorithm checks the z-value of the pixel
coordinates (in the frame buffer) that it is trying to draw to. If the existing pixel at these coo
(i.e. if there already was a pixel) has a z-value further from the viewer than the pixel we are
draw, then the colour and depth of the existing pixel are updated, otherwise it continues wit
to the colour buffer or the depth buffer.
Advantages:(1 mark for either answer)
easy to implement in either software or hardware
it is compatible with pipeline architectures - can execute at the same speed at which vertice
b) Orthogonal, oblique and axonometric view scenes are all parallel view scenes. Define th
parallel view and explain the differences between orthogonal, axonometric, and oblique
scenes. (5)
Answer:
Parallel views - views with the COP at infinity.
Orthogonal views - projectors are perpendicular to the projection plane and projection plane
to one of the principal faces of an object. A single orthogonal view is restricted to one princi
of an object.
Axonometric view - projectors are perpendicular to the projection plane but projection plane
any orientation with respect to object.
Oblique projection - projectors are parallel but can make an arbitrary angle to the projection
and projection plane can have any orientation with respect to object.
[TURN OVER]
, lOMoARcPSD|31863004
3 COS340-A
October/November 2009
QUESTION 2 [8]
a) Define the term homogeneous coordinates and explain why they are used in computer
Answer:
Homogeneous coordinates are four dimensional column matrices used to represent both po
vectors in three dimensions.
When points and vectors are represented using 3-dimensional colum
matrices one cannot distinguish between a point and a vector, with homogeneous coordinat
can make this distinction.
marks can be awarded for any of the points mentioned below:
A matrix multiplication in 3-dimensions cannot represent a change in frames, while this can
using homogeneous coordinates.
All affine transformations can be represented as matrix multiplications in homogeneous coo
Less arithmetic work is involved when using homogeneous coordinates.
The uniform representation of all affine transformations makes carrying out successive tran
far easier than in 3 dimensional space.
Modern hardware implements homogeneous coordinates operations directly, using paralleli
achieve high speed calculations.
b) Consider the line segment with endpoints a and b at (1, 2, 3) and (2, 1, 0) respectively.
the coordinates of vertices a and b that result after an anticlockwise rotation by 15 abo
axis.(Show your workings) (4)
Hint: The transformation matrix for rotation around the z-axis is
(where θ is the angle of anticlockwise rotation).
[TURN OVER]
Downloaded by Gabriel Musyoka ()
, lOMoARcPSD|31863004
4 COS340-A
October/November 2009
Then, to rotate a' and b' by 15 about the z-axis, we use the rotation matrix
Similarly
So a'' = (0.448, 2.191, 3)
and b'' = (1.673, 1.484, 0) (4)
QUESTION 3 [8]
OpenGL is a pipeline model. In a typical OpenGL application, a vertex will go through a seque
transformations or change of frames. In each frame the vertex has different coordinates.
a) Name these coordinates in the order that they occur in the OpenGL vertex transformation
[5]
[TURN OVER]
Downloaded by Gabriel Musyoka ()