Vous êtes sur la page 1sur 8

DATABASE STRUCTURE FOR GRAPHICS MODELING

The database of the graphical representation of the model is present in the computer
system in a form convenient for use.The major functions of a database are to manipulate
the data on screen,such as Zooming and panning;to interact with the user,essentially for
the purpose of editing functions like trimming,filleting,stretching,etc.;to evaluate the
properties like areas, volumes,inertias,etc.; and to provide additional information like
manufacturing specifications.
DATABASE MODELS:
The more common data models used in database management systems are
• The hierarchical model,
• The network model,
• The relationalmodel.

2 D GEOMETRIC TRANSFORMATIONS

BASIC TRANSFORMATION
Animations are produced by moving the 'camera' or the objects in a scene along
animation paths. Changes in orientation, size and shape are accomplished with geometric
transformations that alter the coordinate descriptions of the objects. The basic geometric
transformations are translation, rotation, and scaling. Other transformations that are often
applied to objects include reflection and shear.

Use of transformations in CAD


In mathematics, "Transformation" is the elementary term used for a variety of operation
such as rotation, translation, scaling, reflection, shearing etc. CAD is used throughout the
engineering process from conceptual design and layout, through detailed engineering and
analysis of components to definition of manufacturing methods. Every aspect of
modeling in CAD is dependent on the transformation to view model from different
directions we need to perform rotation operation. To move an object to a different
location translation operation is done. Similarly Scaling operation is done to resize the
object.

Coordinate Systems
In CAD three types of coordinate systems are needed in order to input, store and display
model geometry and graphics. These are the Model Coordinate System (MCS),
theWorld Coordinate System (WCS) and the Screen Coordinate System (SCS). Model
Coordinate System The MCS is defined as the reference space of the model with respect
to which all the model geometrical data is stored. The origin of MCS can be arbitrary
chosen by the user.
World Coordinate System
As discussed above every object have its own MCS relative to which its geometrical data
is stored. Incase of multiple objects in the same working space then there is need of a
World Coordinate System which relates each MCS to each other with respect to the
orientation of the WCS. It can be seen by the picture shown below.

Screen Coordinate System


In contrast to the MCS and WCS the Screen Coordinate System is defined as a two
dimensional device-dependent coordinate system whose origin is usually located at the
lower left corner of the graphics display as shown in the picture below. A transformation
operation from MCS coordinates to SCS coordinates is performed by the software before
displaying the model views and graphics.

Viewing Transformations
As discussed that the objects are modeled in WCS, before these object descriptions can
be projected to the view plane, they must be transferred to viewing coordinate system.
The view plane or the projection plane, is set up perpendicular to the viewing zv axis.
The World coordinate positions in the scene are transformed to viewing coordinates,
then viewing coordinates are projected onto the view plane.
The transformation sequence to align WCS with Viewing Coordinate System is.
1. Translate the view reference point to the origin of the world coordinate system.
2. Apply rotations to align xv, yv, and zv with the world xw, yw and zw axes, respectively.
TRANSLATION
A translation is applied to an object by repositioning it along a straight line path from
one coordinate location to another. We translate a two-dimensional point by adding
translation distances, tx and ty, to the original coordinate position (x,y) to move the point
to a new position (x',y')

The translation distance pair (tx, ty) is called translation vector or shift vector

Matrix representation of translation

This allows us to write the two-dimensional translation equations in the matrix form:

ROTATION
A two-dimensional rotation is applied to an object by repositioning it along a circular
path in the x-y plane. When we generate a rotation we get a rotation angle (θ) and the
position about which the object is rotated (xr , yr) this is known as rotation point or
pivot point. The transformation can also be described as a rotation about rotation axis
that is perpendicular to x-y plane and passes through the pivot point. Positive values for
the rotation angle define counter-clockwise rotations about the pivot point and the
negative values rotate objects in the clockwise direction.
SCALING
Scaling is a kind of transformation in which the size of an object is changed. Remember
the change is size does no mean any change in shape. This kind of transformation can be
carried out for polygons by multiplying each coordinate of the polygon by the scaling
factor. Sx and Sy which in turn produces new coordinate of (x,y) as (x',y'). The equation
would look like

or

here S represents the scaling matrix.

NOTE: If the values of scaling factor are greater than 1 then the object is enlarged and if
it is less that 1 it reduces the size of the object. Keeping value as 1 does not changes the
object.

Uniform Scaling: To achieve uniform scaling the values of scaling factor must be kept
equal.
Differential Scaling: Unequal or Differential scaling is produce incases when values for
scaling factor are not equal.

As per usual phenomenon of scaling an object moves closer to origin when the values of
scaling factor are less than 1. To prevent object from moving or changing its position
while is scaling we can use a point that is would be fixed to its position while scaling
which is commonly referred as fixed point (xf yf).

REFLECTION

Reflection is nothing more than a rotation of the object by 180o. In case of reflection the
image formed is on the opposite side of the reflective medium with the same size.
Therefore we use the identity matrix with positive and negative signs according to the
situation respectively.

The reflection about the x-axis can be shown as:

The reflection about the y-axis can be shown as:

REFLECTION ABOUT A ORIGIN


When both the x and y coordinates are flipped then the reflection produced is relative to
an axis that is perpendicular to x-y plane and that passes through the coordinate origin.
This transformation is referred as a reflection relative to coordinate origin and can be
represented using the matrix below.

REFLECTION ABOUT AN ARBITRARY LINE

Reflection about any line y= mx + c can be accomplished with a combination of


translate-rotate-reflect transformations.
Steps are as follows
1. Translate the working coordinate system (WCS) so that the line passes through the
origin.
2. Rotate the WCS such that one of the coordinate axis lies onto the line.
3. Reflect about the aligned axis
4. Restore the WCS back by using the inverse rotation and translation transformation.

REFLECTION ABOUT AN ARBITRARY POINT


As seen in the example above, to reflect any point about an arbitrary point P (x,y) can be
accomplished by translate-reflect transformation i.e. the origin is first translated to the
the arbitrary point and then the reflection is taken about the origin. And finally the origin
is translated back to its original position.
The whole process can be visualized using the animation below.

HOMOGENEOUS COORDINATES

We have seen that basic transformations can be expressed in matrix form. But many
graphic application involve sequences of geometric transformations. Hence we need a
general form of matrix to represent such transformations. This can be expressed as:

Where P and P' - represent the row vectors.


T1 - is a 2 by 2 array containing multiplicative factors.
T2 - is a 2 element row matrix containing translation terms.

We can combine multiplicative and translational terms for 2D geometric transformations


into a single matrix representation by expanding the 2 by 2 matrix representations to 3 by
3 matrices. This allows us to express all transformation equations as matrix
multiplications, providing that we also expand the matrix representations for coordinate
positions. To express any 2D transformations as a matrix multiplication, we represent
each Cartesian coordinate position (x,y) with the homogeneous coordinate triple
(xh,yh,h),
such that

Thus, a general homogeneous coordinate representation can also be written as (h.x, h.y,
h). For 2D geometric transformations, we can choose the homogeneous parameter h to
any non-zero value. Thus, there is an infinite number of equivalent homogeneous
representations for each coordinate point (x,y). A convenient choice is simply to h=1.
Each 2D position is then represented with homogeneous coordinates (x,y,1). Other
values for parameter h are needed, for eg, in matrix formulations of 3D viewing
transformations.

Expressing positions in homogeneous coordinates allows us to represent all geometric


transformation equations as matrix multiplications. Coordinates are represented with
three element row vectors and transformation operations are written as 3 by 3 matrices.
For Translation, we have

or

Similarly for Rotation transformation, we have

or

Finally for Scaling transformation, we have

or

3D GEOMETRIC TRANSFORMATION
GENERAL 3-D ROTATION
Rotation in three dimension is more complex than the rotation in two dimensions. Three
dimensional rotations require the prescription of an angle of rotation and an axis of
rotation. The canonical rotations are defined when one of the positive x,y,z coordinate
axis is chosen as the axis of rotation. then the construction of rotation transformation
proceeds just like that of a rotation in two dimensions about the origin.
Steps to be performed
1. Translate origin to A1

2. Align vector with axis (say, z)


1. Rotate to bring vector in yz plane

2. Rotate to bring vector along z-axis

3. Rotate line P1P2 about z-axis which is already aligned with the Rotation axis.
4. Reverse steps 2
5. Reverse step 1

Vous aimerez peut-être aussi