21
Computer Graphics Coms 385 Fall 2003

Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Embed Size (px)

Citation preview

Page 1: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Computer Graphics

Coms 385Fall 2003

Page 2: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Introduction

Lecture 1Wed, Aug 27, 2003

Page 3: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

The Syllabus

Syllabus.html

Page 4: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Introduction

What are the goals of computer graphics? Realism Information Art

In this course, we will most often be concerned with realism.

Page 5: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Introduction

The main application areas of computer graphics. Scientific imaging. Computer games. Movies.

Page 6: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Introduction

What are the goals of this course? To learn the principles of computer

graphics. To learn the issues in computer

graphics. To apply these principles in programs

using the OpenGL graphics library.

Page 7: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Introduction

What are not the goals of this course? To learn OpenGL. To create complicated data

structures. To learn complicated mathematics.

Page 8: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Introduction

Nevertheless, we will Learn OpenGL. Create complicated data structures. Learn complicated mathematics.

But we will try to keep the second two to a minimum in your programs.

Page 9: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Introduction

What else are not the goals of this course? To use graphics packages to create graphics

(without programming). Adobe Photoshop. Maya.

We will learn to program the graphics.In other words, this is a programming course.

Page 10: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Computer Prerequisites

C++ programming (Coms 261)Data structures (Coms 262)

Page 11: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Mathematics Prerequisites

Some calculus, maybe.Some linear algebra. Vectors Matrices

We will introduce the necessary mathematics on a need-to-know basis.A high-school-level knowledge of these topics will probably be sufficient.

Page 12: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Programming Style

Rendering a scene can be computationally intensive.Yet, for satisfactory animation the scene must be rendered in less than 1/60 sec. (Why?)Therefore, we place a premium on program efficiency.

Page 13: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Programming Style

This permits us to do things that otherwise might be considered poor programming style.When deciding how to implement a function, we will choose the method that will execute the fastest, even if it is a bit more complicated or a bit less intuitive than other methods.

Page 14: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Programming Style

We will make generous use of global variables to reduce the number of function parameters passed.Consequences Most functions will return void. Most functions will have few, if any,

parameters. Functions will have “side effects.”

Page 15: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Programming Style

When creating C++ classes, we will often make data members public.Then we can access them directly without going through inspectors or mutators.

Page 16: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Programming Style

HOWEVER!Whenever we violate good programming guidelines, we should be able to justify it in terms of program efficiency.

Page 17: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Chapter 1

Introduction to Computer Graphics

Page 18: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Raster Displays

A raster display consists of a rectangular array of picture elements, called pixels.Each pixel emits a single color.The color of each pixel is stored in the framebuffer.The image rendered is the combined effect of these pixels.

Page 19: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Rasterized Lines

A rasterized line appears as a series of pixels in grid positions.This can produce “the jaggies.”

Page 20: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

The Jaggies

For which lines are the jaggies most obvious?For which lines are the jaggies least obvious?Antialiasing reduces the effect of the jaggies.

Page 21: Computer Graphics Coms 385 Fall 2003. Introduction Lecture 1 Wed, Aug 27, 2003

Examples

HSC Display.cppFunctionPlotter.exe