MEG 361 CAD Chapter 3 - PowerPoint PPT Presentation

1 / 37
About This Presentation
Title:

MEG 361 CAD Chapter 3

Description:

MEG 361 CAD Chapter 3 Basic Concepts of Graphics Programming Interactive shape manipulation plays a major role in CAD/CAM/CAE Programming for graphics display on ... – PowerPoint PPT presentation

Number of Views:188
Avg rating:3.0/5.0
Slides: 38
Provided by: Dr1325
Category:
Tags: cad | meg | chapter | devices | input

less

Transcript and Presenter's Notes

Title: MEG 361 CAD Chapter 3


1
MEG 361 CADChapter 3
  • Basic Concepts of Graphics
  • Programming

2
Interactive shape manipulation plays a major role
in CAD/CAM/CAE
  • Programming for graphics display on monitor is
    essential part of CAD/CAM/CAE software

3
Graphics Libraries
  • Graphics Software may be divided into two
    groups
  • device driver and
  • graphics libraries.

4
Graphics Libraries

More
5
Graphics Libraries
  • Device Driver is a set of machine-dependant
    codes that directly controls the display
    processing unit of a graphics device so that the
    electron beam is cast at the desired location.
    Each device driver (machine-dependant) has only a
    primitive capability, and so a graphics program
    written with such commands would be very long if
    any meaningful task to be performed. A program
    with poor readability will result.

6
Graphics Libraries

More
7
Graphics Libraries
  • Graphics Libraries
  • Similar to the math libraries in conventional
    programming, the graphics library is a set of
    subroutines , each of which has a specific
    purpose. For example, a subroutine might draw a
    line or subroutine might draw a circle. The
    graphics library is built on top of the device
    driver as shown below. Each subroutine is
    created by using a supporting set of device
    driver commands, for example a subroutine for
    drawing a drawing a short straight-line segment,
    circle might be composed of series of device
    driver commands

More
8
Graphics Libraries
  • Examples of Existing Graphics Libraries
  • Core graphics provided in 1977, SIGGraph of the
    Association of Computing Machinery (ACM)
  • It does not provide enough commands to use all
    raster graphics systems.
  • GKS was developed by (ISO) in about 1977.

More
9
Graphics Libraries
  • Examples of Existing Graphics Libraries.
  • Both CORE and GKS have some deficiencies with
    regard to supporting dynamic display and
    versatile user interaction.
  • OpenGL , set of libraries developed by Silicon
    Graphics Company, runs under MSwindows NT. It
    becomes the standard graphics library.

10
Coordinate Systems
  • Basic tasks to display an image of an object
    on a graphics device
  • Specifying the location of all points on the
    object in space.
  • Determining which locations on the display
    monitor to be occupied by those points .

More
11
Coordinate Systems
  • Thus a coordinate system is necessary to
    provide a reference for specifying the location
    of a point both in space and on the monitor

More
12
Coordinate Systems
  • 1 Device coordinate system
  • Is used as the reference in defining a location
    on the display monitor.
  • The origin of u-v-z axes is chosen arbitrary.

screen
u
v
v
v
u
u
z
More
13
Coordinate Systems
  • 2 Virtual device coordinate system
  • Has the same origin.
  • The origin of u-v-z axes is in the lower left
    part. Graphics programmer specifies a shape
    consistently regardless of the DCS.

screen
v
u
More
14
Coordinate Systems
  • Device coordinate system and
  • Virtual device coordinate system are
    2-Dimesional

More
15
World Coordinate System (WCS)
  • Is used to describe how the world of interest
    looks like.
  • It is 3-Dimesional.

It describes the locations and orientations of
desks, chairs, and the blackboard if our world is
a classroom.
More
16
Model Coordinate System (MCS)
  • Is used to describe the shape of a part w.r.t.
    MCS attached to it.
  • It is 3-Dimesional.

In MCS the coordinates of points on the part do
not change their values even when the part is
translated and/or rotated .
More
17
Model Coordinate System (MCS)..
  • The location and orientation of each part are
    then specified by WCS.
  • The coordinates of all points of the parts are
    obtained in WCS using transformation matrices.

More
18
Two Types of Projection

Perspective Projection
Parallel Projection
More
19
Transformation bet. Coordinate Systems
20
Window and Viewport
  • Window defines the region in space that will be
    projected onto the display monitor so that any
    object outside the space of the monitor will not
    be displayed

Viewport(s) is the area(s) on the display monitor
where we want the projected image to appear.
Parallel Projection
More
21
Window and ViewportOpenGL Sample
Parallel Projection
22
Output primitives
  • are the graphics elements that can be displayed
    by a graphics libraray.
  • Line, Polygon, marker and Text are examples of
    output primitives.

23
Graphics Input
  • Graphics program accepts points, lines, or
    polygons as input in addition to numbers and
    text strings (e.,g select a polygon among all
    the graphics elements on the display
  • Locator and Button are two types of physical
    device.

24
Graphics InputLocator and Button
  • Locator transfers location of cursor to the
    graphics program (mouse ball)
  • Button transfers action of user on or off at
    current cursor location (mouse button)

25
Representation of Cureves
  • In solid modeling and computer aided drafting
    systems, curve equation itself or its attributes
    (center point, radius,..) have to be stored .

26
Representation of Cureves
  • Curve equations
  • nonparametric
  • Parametric,(x, y, z are related with a
    parameter ( ? )

27
Representation of CurevesCircle
  • Nonparametric
  • Parametric

28
Conic Sections
29
See meg361_.....doc
parametric representation of curve Line -------
--------- example fro the position vector
P112 P243plot the line t0.011 x13
t y2t plot(x,y)grid xlabel('x'),ylabel('y')
axis(0 5 0 5)
30
meg361 parametric representation of curve
parabola ---------------- example Generate
the parabolic segment in the first quadrant for
1ltxlt4 for the parabola given by x1th2,
y2th, ie a1 plot the segment of the
parabola a1 xmin1xmax4 thminsqrt(xmin/a) t
hmaxsqrt(xmax/a) ththmin(thmax-thmin)/101thma
x xath.2 y2ath plot(x,y)grid xlabel('x'
),ylabel('y') axis(0 5 0 5)
31
Linear TransformationTranslation
32
Linear TransformationRotation
Rotation _at_ x-axis
33
Linear TransformationRotation
Rotation _at_ x-axis
34
Linear TransformationRotation
Rotation _at_ x-axis...
Rot_x
35
Linear TransformationRotation
Similarly Rotation _at_ y-axis...
Rot_y
36
Linear TransformationRotation
Similarly Rotation _at_ z-axis...
Rot_z
37
Linear TransformationGraphics Library
Example how transformation matrix is called
Write a Comment
User Comments (0)
About PowerShow.com