Lecture 1 1538730470
Lecture 1 1538730470
Computer Graphics
From www.autodesk.com
Introduction, overview and OpenGL 8
Computer Aided Design (CAD)
From www.amabilis.com
Introduction, overview and OpenGL 9
Computer Aided Design (CAD)
From www.alibre.com
From molvis.sdsc.edu/dna
Introduction, overview and OpenGL 14
Data visualizations
From www.flyit.com
Introduction, overview and OpenGL 16
Computer Art
From www.blender.org
Introduction, overview and OpenGL 17
Computer Art (cont.)
From www.blender.org
Introduction, overview and OpenGL 18
Computer Art (cont.)
From moca.virtual.museum
Introduction, overview and OpenGL 19
Entertainment
From www.microsoft.com
Introduction, overview and OpenGL 24
Image processing
From www.ph.tn.tudelft.nl
Introduction, overview and OpenGL 25
Image processing (cont.)
From www.wikipedia.org
Introduction, overview and OpenGL 26
Graphical User Interfaces
Application
Application Graphics Display
Data
Program System Device
Structure/Model
Graphics Devices
-Output Devices
(Display Screen; View Surface)
-Input Devices
(Interaction Devices)
Introduction, overview and OpenGL 29
Graphics Devices
Output Devices
CRT Displays
Input Devices
Locator
Stroke
Input Hard Copy
String (Keyboard)
Valuator
Choice (Button)
Pick
1
2
3
4
5
6
7
8
First, all points on the even-numbered (solid) scan lines are displayed; then
all points along the odd-numbered (dashed) lines are displayed.
Color 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
Introduction, overview and OpenGL 39
from wikipedia.org
Cathode Ray Tube
10 %
Time
persistence
Fluorescence
Phosphorescence
Refresh rate
# of times/sec a picture is redrawn
required to be flicker-free
60 Hz for raster scan displays
For refresh displays, it depends on picture complexity !!!
Why ?
Sharpness
inter-dot distance
dot pitch dot size, spot size
energy
1 spot size
Resolution = 1 / spot size
0.5 ~ 0.6
However, informally
distance # of points / scan line
# of lines / frame
electron beam
Addressability = 1 / inter-dot distance
Aspect Ratio
The aspect ratio of vertical points to horizontal points neces-
sary to produce equal length of lines in both direction on screen
4/3 = 1.33...
l
Note
Sometimes, aspect ratio is stated in terms of the ratio of hori-
zontal to vertical points
3/4 = 0.75
Flat-Panel Displays: Plasma
Viewing
direction
Liquid Crystal
TFT
with a fixed portion of the system memory reserved for the frame
buffer.
Input devices
Keyboards, button boxes, dials
Mouse devices
Trackballs and spaceballs
Joysticks
Data gloves
Digitizers
Image scanners
Touch panels
Light pens
Voice systems
Keyboards
Dials
Light Pen
Graphics Tablets
3D-Tablet
Voice Systems
y+
(a)
y - axis
(b)
Introduction, overview and OpenGL 73
Valuator Devices
1 90
0.5
0 0
180
0 5000
-0.5
-1 270
Button
Menu Selection
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
Special purpose
For non programmers
CAD, CAM, painting, animation
General programming packages
C, C++, Java, …
Library of graphics functions (OpenGL)
Picture components (lines, shapes, …)
Transformations (color, texture, shading, rotating, …)
Cartesian coordinates
Modeling coordinates (local, master)
in the reference frame of each object
World coordinates
in the scene reference frame
Viewing coordinates
view we want of a scene
Normalized (device) coordinates
normalized between –1 and 1 or 0 and 1
Device coordinates (screen coordinates)
The transformation sequence from modeling coordinates to device coordinates for a three-
dimensional scene. Object shapes can be individually defined in modeling-coordinate reference
systems. Then the shapes are positioned within the world-coordinate scene. Next, world-
coordinate specifications are transformed through the viewing pipeline to viewing and projection
coordinates and then to normalized coordinates. At the final step, individual device drivers
transfer the normalized-coordinate representation of the scene to the output devices for display.
Introduction, overview and OpenGL 81
Coordinate Transformations
A 400 by 300 display window at position (50, 100) relative to the top-left
corner of the video display.
Introduction, overview and OpenGL 83
Example Display Window
glVertex3fv( v )
#include <GL/glut.h>
// (or others, depending on the system
in use)
glMatrixMode (GL_PROJECTION);
// Set projection parameters.
gluOrtho2D (0.0, 200.0, 0.0,150.0);
}
Introduction, overview and OpenGL 95
Sample Program (cont.)
void lineSegment (void)
{
glClear (GL_COLOR_BUFFER_BIT);
// Clear display window.
glFlush ( );
// Process all OpenGL routines as quickly as
possible.
} Introduction, overview and OpenGL 96
Sample Program (cont.)
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.
}
Introduction, overview and OpenGL 97
Output