Professional Documents
Culture Documents
by
Tesfamicael.W Arefaine
3D Concepts
3D graphics deals with generating and displaying 3D objects in a 2D
space(display screen).
Considerations we must take in to account, When we model and
display a 3D scene.
1 Object boundaries: constructed with various combinations of plane
and curved surfaces.
2 Specify object interiors information.
3 3D rotation is more complicated as we can rotate an object an axis
with any special orientation.
4 Viewing transformation are more complicated because we have more
parameters to select.
5 Identified Visible parts of a scene and apply surface-rendering
algorithms.
Display Method
To obtain a display of a 3D scene:
1 Set up a coordinate reference for the camera.
This coordinate reference defines the position and orientation for the
plane of the camera film, which is the plane we want to use to display
a view of the objects in the scene.
2 Object descriptions are then transformed to the camera reference
coordinates and Projected to the selected display plane.
Parallel Projection:
Parallel lines in the world-coordinate scene projected into parallel
lines on the 2D display plane.
This technique is used in engineering and architectural drawings to
represent an object with a set of views that maintain relative
proportions of the object.
Perspective Projection
Paralle lines in a scane that are not parallel to the display plane are
projected into converging lines.
This causes objects farther from the viewing position to be displayed
smaller than objects of the same size that are nearer to the viewing
position.
It provides more realistic scane, since this is the way that are eyes
and a camera lens form images.
Depth Cueing
Depth information is important to identify, for a particular viewing
direction, which is the front and back of displayed objects.
Surface Rendering
Added realism is attained in displays by setting the surface intensity
of objects according to
1 The lighting conditions in the scene
2 The assigned surface characteristics.
Lighting specifications include the intensity and positions of light
sources and the general background illumination required for a scene.
Surface properties of objects include degree of transparency and how
rough or smooth the surfaces are to be.
3D Transformations
3D Translations:
In a 3D homogeneous coordinate representation, a point is
translated from position P = (x, y, z) to position P’=(x’, y’, z’) with
the matrix operation.
0
1 0 0 tx x x
0 1 0 ty y y 0 0
0 0 1 tz ∗ z = z 0 , P = T .P
0 0 0 1 1 1
3D Scaling
Scaling changes the size of the object and reposition the object
relative to the coordinate origin.
0
sx 0 0 0 x x
0 sy 0 0 y y 0 0
0 0 sz 0 z = z 0 , S.P = P
0 0 0 1 1 1
3D Scaling
Scaling with respect to a selected pixel position (xf , yf , zf ) can be
represented with the ff transformation:
1 Translate the fixed point to the origin.
2 Scale the object relative to the coordinate origin.
3 Translate the fixed point back to its original position.
The transformation matrix will be:
sx 0 0 (1 − sx )xf
0 sy
0 (1 − sy )yf
0 0 sz (1 − sz )zf
0 0 0 1
3D Rotations
To generate rotation transformation for an object, we must
designate an axis of rotation and amount of angular rotation.
Unlike 2D rotation, where all the transformations are carried out in
the xy plane, a 3D rotation can be specified around any line in space.
Z-axis Rotation:
x’=x cosθ - y sinθ
y’=x sinθ + y cosθ
z’=z
cosθ −sinθ 0 0
sinθ cosθ 0 0
Rz (θ) =
0
0 1 0
0 0 0 1
3D Rotations
X-axis rotation: Y-axis rotation:
x’=x x’=z sin θ + x cos θ
y’=y cos θ - z sin θ y’=y
z’=y sin θ + z cos θ z’=z cos θ - x sin θ
Permutation: Permutation:
x →y →z →x x →z →y →x
1 0 0 0 cosθ 0 sinθ 0
0 cosθ −sinθ 0 0 1 0 0
Rx (θ) =
0 sinθ cosθ 0
Ry (θ) =
−sinθ
0 cosθ 0
0 0 0 1 0 0 0 1
General 3D Rotations
A rotation matrix for any axis that does not coincide with a
coordinate axis can be set up as composite transformation of:
1 Translate the object so that the rotation axis passes through the
coordinate origin.
2 Rotate so that the axis of rotation coincides with one of the
coordinate axis.
3 Perform the specified rotation about the coordinate axis.
4 Apply inverse rotation to bring the rotation axis back to the original
coordinates.
5 Apply inverse translation to bring rotation axis back to its original
position.
3D Viewing
2D viewing
I Transfer positions from the world-coordiante plane to pixel positions
in the viewport of the output device
I Clipping boundaries - the four boundaries of the world coordinate
system
3D viewing
I It is more involved
I We can view an object from any spatial position: from front, from
above, from back, from within, ...
I 3D descriptions of objects must be projected onto the flat viewing
surface of the output device
I Clipping boundaries - a volume of space whose shape depends on the
type of projection
Viewing Pipeline
The steps for computer generation of a view of a 3D scene are
somewhat analogous to the process involved in taking a photograph.
To take a snapshot:
1 Position the camera in space
2 Point the camera at the scene
3 Decide the camera orientation
4 On snapping the shutter,
The scene is cropped to the size of the aperture of the camera
Light from the visible surfaces is projected onto the camera film
Cont’
Cont’
General 3D transformation pipeline, from modeling coordiantes to final
device coordinates.
Viewing Transformation
Before object descriptions can be projected to the view plane, they
must be transferred to viewing coordinates
Transformation that superimposes the viewing reference frame onto
the world frame using the basic geometric transformations
1 Translate the view reference point to the origin of the
world-coordinate system
2 Apply rotations to align the xv , yv , and zv axes with the world xw ,
yw , and zw axes respectively
Projections
Our eyes collapse 3-D world to 2-D retinal image
In this Computer graphics, this process is done with projection
Once world-coordianate descriptions of the objects in a scene are
converted to viewing coordinates, we can project the 3D objects on
to the 2D view plane
Projection types
1 Parallel projection - coordinate positions are transformed to the
view plane along parallel lines
2 Perspective projection - coordinate positions are transformed to
the view plane along lines that converge to a point called the
projection reference point
I The projected view of an object is determined by calculating the
intersection of the projection lines with the view plane
Parallel Projections
Preserve relative proportions of objects
Used in drafting to produce scale drawings of 3D objects
Don’t give us realistic representations of the appearance of 3D
objects
Specified with a projection vector that defines the direction of the
projection lines
Orthographic projection
Transform points along projection lines that
I are parallel
I have the focal point at infinity
I are orthogonal to the view plane
Camera analogy - telephoto lens
Projection Equations
If the view plane is placed at position zvp along the zv axis, any
point (x, y , z) in viewing coordinates is transformed to projection
coordinates as
I xp = x
I yp = y
I zp = zvp
The original z-coordinate value is preserved for depth information
needed in
I depth cueing
I visible surface determination procedures
Cont’
Orthographic projection of a 0 0 0 1
point onto a viewing plane
Perspective Projections
Don’t preserve relative proportions of objects
Produce realistic views
Projections of distant objects are smaller than projections of objects
of the same size that are closer to the projection plane
Transform points along projection lines that meet at the projection
reference point, zprp
Projection Equations
1 Projection reference point - zprp along the zv axis
2 View plane - zvp
3 A point (x, y , z) is projected to the point (xp , yp , zp )
Projection equations
Using similarity of triangles in both the views, we obtain
x(d)
1 xp = zprp −z
y (d)
2 yp = zprp −z
3 zp =zvp
The perspective projection matrix can be written as follows
1 0 0 0
0 1 0 0
−zvp zprp
Mperspective =
0 0 d zvp ( d )
−1 zprp
0 0 d d
Perspective division
Applying the perspective projection matrix on a point (x, y , z)
results in new point (xh , yh , zh )
zprp −z
Dividing the point (xh , yh , zh ) by h= d results in the projected
point (xp , yp , zp )
The original z-coordinate value is retained in projection coordinates
for visible surface and other depth processing
View Volume
Given a view window - a view volume can be set up using the
boundaries of the view window
Size of view volume - depends on the size of the window
Shape of view volume - depends on the type of projection
1 parallel projection - an infinite parallelpiped
2 perspective projection - pyramid with apex at the projection reference
point