Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 25

Computer Aided Design

and Manufacture
Graphics Programming
Computer Graphics
 Computer graphics allows the designer to
project an image onto a graphic screen for
manipulation.
 change the scale of an image to see some details
more clearly
 rotate an image to a certain angle to get a better
view of an object
 translate an image to another location to display
it in a different environment.
Computer Graphics
 These are the basic functions of computer
graphics and can be accomplished by using
geometric transformation techniques.
Cartesian Coordinate System

A right-hand Cartesian coordinate system


Polar Coordinate System

A point in a polar coordinate system


Coordinate System
 A cylindrical coordinate system having
parameters l, α, and z is given as follows:
x = l cos α
y = l sin α
z=z

 The standard way of representing the three


coordinates is in the form of a vector as
follows:  xi 
Pi   yi 
 zi 
Coordinate System
 The two basic tasks required to display an
image of an object on a graphics device are:

 specifying the location of all the points on the


object in space, and

 determining which locations on the display


monitor are to be occupied by those points.
Types of Coordinate Systems
 Three such coordinate systems that define
the location of a point in three-dimensional
space are:

 the world coordinate system,

 model coordinate system, and

 viewing coordinate system.


The relationship among
coordinate systems.
Types of projection

(a) perspective and (b) parallel


Viewpoint and Viewsite
Transformations between
coordinate systems
Geometric Transformation
 There are two types of geometric
transformation:
 Transforming the object
 Transforming the object moves the object within the
existing coordinate system

 Transforming the coordinate system


 Transforming the coordinate system moves the
coordinate system and then the object is viewed from
the new coordinate frame.
Translation of an object
Equation

Homogenous
Transformation
Matrix

Object under
transformation in
in 3D space
Rotation about the x axis
Rotation
Object under Rotation onto yz plane
Rotation

Equation

Object under
Rotation onto yz
plane

Homogenous
Transformation
Matrix
Rotations

Rot(x,theta)

Rot(
Example
Mapping between two
coordinate system
Equation

Object under
Rotation onto yz
plane

Mapping
Transformation
Matrix
Mapping example
 Corresponding to the viewpoint (-10, 0,1), the viewsite (0, 0, 1)
and the up vector (0, 0, 1), the viewing coordinate system is
drawn. From the relative position between the viewing
coordinate system and the world coordinate system: (1)
calculate the mapping transformation Tw-v (2) Calculate the
coordinates of the point in viewing coordinates if it has world
coordinates of (5, 0, 1).
Mapping example
 Corresponding to the viewpoint (-10, 0,1), the viewsite (0, 0, 1)
and the up vector (0, 0, 1), the viewing coordinate system is
drawn. From the relative position between the viewing
coordinate system and the world coordinate system: (1)
calculate the mapping transformation Tw-v (2) Calculate the
coordinates of the point in viewing coordinates if it has world
coordinates of (5, 0, 1).
Scaling
 To scale an object up or down sx times in x, sy times
in y, and sz times in the z direction, the following
transformation matrix is applied:

 A viewport or window can be scaled without changing


the coordinates of the object.
Scaling
 While scaling is normally from the origin, the object
can be scaled from a point p.

 First, a translational,Trans(-Xp, -Yp, -Zp) is applied to


the point for the object to move to the origin, then
the scaling matrix in the above equation is applied,
and finally Trans(Xp,Yp,Zp) is applied to move the
object back to its original position.
Mirror reflection
 An xy the mirror reflection can be accomplished with
the following matrix. Only the sign of the z
coordinate has to be reversed

 The transformation matrix for other mirror


reflections, with the yz plane or the xz plane as a
mirror, can be derived in the same way.

You might also like