Lecture 01
Lecture 01
Lecture 01
From www.autodesk.com
Computer Aided Design (CAD)
From www.amabilis.com
Computer Aided Design (CAD)
From www.alibre.com
Computer Aided Design (CAD)
From www.intellicad.org
Virtual Reality Environments
From www.flyit.com
Data visualizations
From molvis.sdsc.edu/dna
Data visualizations
From www.flyit.com
Computer Art
From www.blender.org
Computer Art
From www.blender.org
Computer Art
From moca.virtual.museum
Entertainment
Entertainment
Entertainment
Entertainment
Entertainment
From www.microsoft.com
Image processing
From www.ph.tn.tudelft.nl
Image processing
From www.wikipedia.org
Graphical User Interfaces
Contents of the Course
Basic concepts of computer graphics
Computer graphics hardware and software
Output primitives
Basic techniques
2D and 3D graphics, transformations
OpenGL
Overview of Graphics Systems
Video Display Devices
Raster Scan Systems
Graphics Workstations and Viewing Devices
Input Devices
Hard Copy Devices
Graphics Networks
Graphics on the Internet
Graphics Software
Cathode Ray Tube
from wikipedia.org
Cathode Ray Tube
Illustration showing the interior of a cathode-ray tube for color televisions and monitors.
Numbers in the picture indicates:
1.Electron guns 2.Electron beams 3. Mask for separating beams for red, green and
blue part of displayed image 4. Phosphor layer with red, green, and blue zones
5.Close-up of the phosphor-coated inner side of the screen from wikipedia.org
Cathode Ray Tube
from wikipedia.org
Three Dimensional Viewing Devices
For the display of 3D scenes
Reflects a CRT image from a vibrating, flexible
mirror
Allows to walk around an object or scene and
view it from different sides
Stereoscopic and Virtual-Reality
Systems
Not true 3D images, but provides a 3D effect.
Uses two views of a scene along the lines of
right and left eye. Gives perception of a scene
depth when right view is seen from right eye and
left scene is seen from left eye (stereoscopic
effect). Display each view at alternate refresh
cycles.
Input Devices
Input devices
Keyboards, button boxes, dials
Mouse devices
Trackballs and spaceballs
Joysticks
Data gloves
Digitizers
Image scanners
Touch panels
Light pens
Voice systems
Hard-copy Devices
Hard-copy devices
Plotters
2D moving pen with stationary paper
1D pen and 1D moving paper
Printers
Impact devices
Inked ribbon
Non impact devices
Laser, ink-jet, xerographic, electrostatic, electrothermal.
Graphics Software
Graphics software
Special purpose
For non programmers
CAD, CAM, painting, animation
Attributes
Color, line style, text style, area filling patterns
Geometric Transformations
Change size, position or orientation of an object
Graphics Functions
Viewing Transformations
Select a view of the scene, type of projection to be
used, location of the view on the video monitor
Input functions
Control and process data flow from interactive
devices
Control operations
Clear the screen display area, initialize parameters
Introduction to OpenGL
First part of Silicon Graphics graphics
workstations (formerly GL)
De facto graphics standard
Became hardware independent in early 1990s
and named as OpenGL
Developed especially for 3D scenes
2D scenes as projections where z-coordinate is
0.
OpenGL (Open Graphics Library)
Graphics rendering API (Application
Programmer’s Interface)
A software interface to graphics hardware
Generation of high-quality color images composed
of geometric and image primitives
Window system independent
glVertex3fv( v )
glMatrixMode (GL_PROJECTION);
// Set projection parameters.
gluOrtho2D (0.0, 200.0, 0.0,150.0);
}
Sample Program
void lineSegment (void)
{
glClear (GL_COLOR_BUFFER_BIT);
// Clear display window.
glFlush ( );
// Process all OpenGL routines as quickly as
possible.
}
Sample Program
void main (int argc, char** argv)
{
glutInit (&argc, argv); // Initialize GLUT.
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
// Set display mode.
glutInitWindowPosition (50, 100);
// Set top-left display-window position.
glutInitWindowSize (400, 300);
// Set display-window width and height.
glutCreateWindow ("An Example OpenGL Program");
// Create display window.
init ( );
// Execute initialization procedure.
glutDisplayFunc (lineSegment);
// Send graphics to display window.
glutMainLoop ( );
// Display everything and wait.
}
Output
Specifying Geometric Primitives
Primitives are specified using
glBegin( primType );
glVertex…
…
glEnd();
primType determines how vertices are combined
Geometric Primitive Types
Geometric Primitive Types
GL_POINTS : Draws a point at each of the n vertices.
GL_LINES : Draws a series of unconnected line
segments. Segments are drawn between v0 and v1, between v2
and v3, and so on. If n is odd, the last segment is drawn between
vn-3 and vn-2, and vn-1 is ignored.
GL_LINE_STRIP : Draws a line segment from v0 to v1, then
from v1 to v2, and so on, finally drawing the segment from vn-2
to vn-1. Thus, a total of n-1 line segments are drawn. Nothing is
drawn unless n is larger than 1. There are no restrictions on the
vertices describing a line strip (or a line loop); the lines can
intersect arbitrarily.
GL_LINE_LOOP : Same as GL_LINE_STRIP, except that a
final line segment is drawn from vn-1 to v0, completing a loop.
Geometric Primitive Types
GL_TRIANGLES : Draws a series of triangles (three-
sided polygons) using vertices v0, v1, v2, then v3, v4, v5, and so
on. If n isn't an exact multiple of 3, the final one or two vertices
are ignored.
GL_TRIANGLE_STRIP : Draws a series of triangles (three-
sided polygons) using vertices v0, v1, v2, then v2, v1, v3 (note
the order), then v2, v3, v4, and so on. The ordering is to ensure
that the triangles are all drawn with the same orientation so that
the strip can correctly form part of a surface. Preserving the
orientation is important for some operations, such as culling.
(See "Reversing and Culling Polygon Faces") n must be at least 3
for anything to be drawn.
GL_TRIANGLE_FAN :Same as GL_TRIANGLE_STRIP,
except that the vertices are v0, v1, v2, then v0, v2, v3, then v0,
v3, v4, and so on.
Geometric Primitive Types
GL_QUADS : Draws a series of quadrilaterals
(four-sided polygons) using vertices v0, v1, v2, v3, then v4, v5,
v6, v7, and so on. If n isn't a multiple of 4, the final one, two, or
three vertices are ignored.
GL_QUAD_STRIP : Draws a series of quadrilaterals
(four-sided polygons) beginning with v0, v1, v3, v2, then v2, v3,
v5, v4, then v4, v5, v7, v6, and so on (see Figure 2-7). n must be
at least 4 before anything is drawn. If n is odd, the final vertex is
ignored.
GL_POLYGON :Draws a polygon using the points
v0, ... , vn-1 as vertices. n must be at least 3, or nothing is drawn.
In addition, the polygon specified must not intersect itself and
must be convex. If the vertices don't satisfy these conditions, the
results are unpredictable.
Valid and Invalid Polygons
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: