0% found this document useful (0 votes)
24 views11 pages

CH 3

Uploaded by

abenimelos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views11 pages

CH 3

Uploaded by

abenimelos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

DEBARK UNIVERSITY

Department of Computer Science


Computer Graphics

Chapter 3

Rendering Process with OpenGL

1
OpenGL Coordinate system
 In a 2-D coordinate system, the X axis generally points from
left to right, and the Y axis generally points from bottom to
top. (Although some windowing systems will have their Y
coordinates going from top to bottom). When we add the
third coordinate Z, we have a choice as to whether the Z-axis
points into the screen or out of the screen

 In Right Hand Coordinate System (RHS), Z is coming out of


the screen and in Left Hand Coordinate System (LHS), Z is
going into the screen. Generally OpenGL uses a right-hand
coordinate system
2
Cont…
 In a typical graphics program, we need to deal with a
number of different coordinate systems, conversion of
coordinates from one system to another is very important
 Model Coordinate System is defined as 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.

3
Contd…
 World Coordinate System As discussed above every object
has its own MCS relative to which its geometrical data is
stored. In case 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 above
 Hierarchical Coordinate Systems Sometimes objects in a
scene are arranged in a hierarchy, so that the "position" of one
object in the hierarchy is relative to its parent in the hierarchy
scheme, rather than to the world coordinate system. For
example, a hand may be positioned relative to an arm, and
the arm relative to the torso. When the arm moves, the hand
moves with it, and when the torso moves, all three objects
move together.

4
Contd…
 Viewpoint Coordinate System Also known as the "camera" coordinates system.
This coordinate system is based upon the viewpoint of the observer, and changes
as they change their view.
 Model Window (Screen) Coordinate System This coordinate system refers to
the subset of the overall model world that is to be displayed on the screen.
Depending on the viewing parameters selected, the model window may be
rectalinear or a distorted viewing frustrum of some kind. This 2D coordinate
system refers to the physical coordinates of the pixels on the computer screen,
based on current screen resolution
 Viewport Coordinate System This coordinate system refers to a subset of the
screen space where the model window is to be displayed. Typically the viewport
will occupy the entire screen window, or even the entire screen, but it is also
possible to set up multiple smaller viewports within a single screen window. 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, and then viewing coordinates are
projected onto the view plan
5
Contd…

6
Viewing Using a Synthetic Camera
synthetic camera is a type of rendering technique that seeks to replicate the

characteristics – especially the distortions (e.g. out of focus, aberration) – of a real

camera or the human eye, rather than the perfectly sharp achromatic pictures usually

produced by computer graphics.

Synthetic camera paradigm

 position of camera

 area of interest (direction camera lens is pointed in)

 orientation (which way is up)

 field of view (wide angle, normal...)

 depth of field (clipping planes, sort of)

 tilt of view/film plane (if not normal to view direction)


7
 perspective or parallel projection? (camera near objects or an infinite distance away)
Output Primitives
Graphics primitives: All graphics packages construct
pictures from basic building blocks
Output Primitives: Basic geometric structures (points,
straight line segment, circles and other conic sections,
quadric surfaces, spline curve and surfaces, polygon color
areas, and character strings)
Geometric primitives: primitives or routines to describe
the geometry (i.e. shape) of objects (components of the
scene), e.g. Point drawing, Line drawing, Polygon
drawing,…
- can be 2-D (points, lines, quadrilaterals, & general polygons)
and more complex 3-D primitives (spheres and polyhedral
(made from mesh of 2-D polygons))
All of these primitives are specified using sequence of vertices
8
Attributes?
Attribute – any parameter that affects the way a
primitive will be displayed
e.g.: Colour, type, line thickness, fill style, etc.
OpenGL maintain a list of current state variables that
are used to modify the appearance of each primitive
as it is displayed
state variables represent attributes of the primitives
All OpenGL state variables have default values
Remain in effect until new values specified
Some state variables can be changed within
glBegin() … glEnd() pairs

9
Contd…
Output Primitive Attributes
Point Size
Color
Line Thickness (1pt, 2pt …)
Type (Dashed, Dotted, Solid)
Color
Text Font (Arial, Courier, Times Roman…)
Size (12pt, 16pt ..)
Spacing
Orientation (Slant angle)
Style (Bold, Underlined, Double lined)
Color
Filled Region Fill Pattern
Fill Type (Solid Fill, Gradient Fill)
Fill Color
Images Color Depth (Number of bits/pixel)

10
Question
s?
Thank You!
11

You might also like