17
Introduction to Computer Graphics Farhana Bandukwala, PhD Lecture 1

Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. OpenGL •

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. OpenGL •

Introduction to Computer Graphics

Farhana Bandukwala, PhDLecture 1

Page 2: Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. OpenGL •

Outline

• People and logistics• Assignments and grading• Graphics: then and now• Image analysis vs graphics• Applications• Introduction to OpenGL

Page 3: Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. 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

Page 4: Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. OpenGL •

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

Page 5: Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. OpenGL •

Catalysts in early 80’s• Raster graphics capable computers

– Xerox Start, Apple MAC, IBM PC• Virtual graphics terminals

– Windows• Direct manipulation

– Point & click

Page 6: Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. OpenGL •

Raster graphics

• Bitmap graphics • Rectangular array of points: pixels• For example: Xerox Star, Mac, IBM PC

Page 7: Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. OpenGL •

Virtual Graphical Terminals

• Windows to organize screen space• Tools: desktop, window manager • Multi-tasking: powerful motivation

Page 8: Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. OpenGL •

Direct Manipulation

• Point-&-Click• Icons and buttons to represent objects and

operators

Page 9: Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. OpenGL •

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

Page 10: Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. OpenGL •

Applications

• User interfaces: most widespread (research areas include HCI)

Page 11: Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. OpenGL •

Applications: Data visualization

• Scientific, molecular, medical

Page 12: Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. OpenGL •

Applications: Publishing

• Photoshop, Framemaker, Word, Powerpoint!

Page 13: Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. OpenGL •

Applications: CAD

• Auto, Engines, Marketing models

Page 14: Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. OpenGL •

Applications: Entertainment

• Games, Movies, Commercials

Page 15: Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. OpenGL •

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

Page 16: Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. OpenGL •

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

Page 17: Introduction to Computer Graphics · 2003. 1. 10. · Applications: CAD • Auto, Engines, Marketing models. Applications: Entertainment • Games, Movies, Commercials. OpenGL •

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();

}