Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Introduction to Computer Graphics
Farhana Bandukwala, PhDLecture 1
Outline
• People and logistics• Assignments and grading• Graphics: then and now• Image analysis vs graphics• Applications• Introduction to OpenGL
People and logistics
• Instructor: Farhana Bandukwala, PhD– Office hours M/W after class or by appt. – Contact information: [email protected]
• TAs: Kuo-Wen Lo, Ninad Dewal– Office hours (TBD)
• Textbooks– Interactive Computer Graphics, by Edward Angel– Open GL Programming Guide by Woo, Neider,Davis and
Shreiner
Assignments and Grading
• Programming assignments worth 250 pts1. Simple Open GL drawing: 25 (+10)2. 2D Curves Rendering: 75 (+15)3. 3D Rendering w/Surfaces & Illumination: 75 (+25)4. Hierarchical Objects & Animation: 75 (+25)
• Midterm exam: worth 75pts• Final exam: worth 75 pts• Syllabus on handout
Catalysts in early 80’s• Raster graphics capable computers
– Xerox Start, Apple MAC, IBM PC• Virtual graphics terminals
– Windows• Direct manipulation
– Point & click
Raster graphics
• Bitmap graphics • Rectangular array of points: pixels• For example: Xerox Star, Mac, IBM PC
Virtual Graphical Terminals
• Windows to organize screen space• Tools: desktop, window manager • Multi-tasking: powerful motivation
Direct Manipulation
• Point-&-Click• Icons and buttons to represent objects and
operators
Graphics vs Image analysis
• Graphics = synthesis – images from model of world
• Image processing = analysis – analysis of picture to build model of the scene
Graphics
Image Analysis/Computer Vision
Applications
• User interfaces: most widespread (research areas include HCI)
Applications: Data visualization
• Scientific, molecular, medical
Applications: Publishing
• Photoshop, Framemaker, Word, Powerpoint!
Applications: CAD
• Auto, Engines, Marketing models
Applications: Entertainment
• Games, Movies, Commercials
OpenGL• Platform independent software API to
graphics hardware– Core Open GL (gl*)
• Allows displaying & transforming models composed of primitives,lights,textures
– OpenGL Utility library (glu*)• High level functions for creating and manipulating
objects– OpenGL Utility Toolkit (glut*)
• Platform independent window management API
Steps to create a picture
1. Construct shapes from primitives using a model of objects
2. Arrange shapes in a “scene”3. Choose a viewing direction 4. Assign attributes (color, texture) to shapes5. Calculate the projection of scene onto display window
Sample OpenGL code#include <GL/glut.h>#include <stdlib.h>
void initViewport(void){glMatrixMode(GL_PROJECTION);glLoadIdentity();glOrtho(0.0,1.0,0.0,1.0,-1.0,1.0);
}
void display(void){// Initialize bufferglClearColor(0.0,0.0,0.0);glClear(GL_COLOR_BUFFER_BIT);
// Initialize attributes (color);glColor3f(1.0,1.0,1.0);
//Draw squareglBegin(GL_POLYGON);glVertex2f(0.25,0.25);glVertex2f(0.25,0.75);glVertex2f(0.75,0.75);glVertex2f(0.75,0.25);glEnd();
//Flush bufferglFlush();
}