cs 410: computer graphics - colorado state universitycs410/yr2014fa/more_progress/l01... · cs 410:...

19
CS 410: Computer Graphics Professor: Ross Beveridge Room 348 CSB (970) 491-5877 Office Hours: Tues 2:00 – 3:00 Thur 9:00 – 10:00 or by appointment [email protected] Teaching Assistant : Jatin Bhikadiya Office Hours: TBD [email protected] Web Site: http://www.cs.colostate.edu/~cs410 1-slide Overview ! This is what you will learn to make ! But you will have to work hard to get there 8/26/14 2 ©J. Ross Beveridge & Bruce A. Draper 2014 Ben Randall Charumathi Chandrasekaran

Upload: lekien

Post on 24-Apr-2018

218 views

Category:

Documents


1 download

TRANSCRIPT

CS 410: Computer Graphics

Professor: Ross Beveridge Room 348 CSB (970) 491-5877 Office Hours:

•  Tues 2:00 – 3:00 •  Thur 9:00 – 10:00 •  or by appointment

[email protected]

Teaching Assistant : Jatin Bhikadiya Office Hours: TBD [email protected]

Web Site: http://www.cs.colostate.edu/~cs410

1-slide Overview

!  This is what you will learn to make

!  But you will have to work hard to get there 8/26/14 2 ©J. Ross Beveridge & Bruce A. Draper 2014

Ben Randall Charumathi Chandrasekaran

Another Example – Fall 2012

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 3

What can you say about this image? In other words, what processes are at work – simulated – to create what you are seeing?

In This Class

You will build a ‘ray tracer’. !  Input

!  Scene model (objects, surfaces & materials) !  Lighting models ! Camera models

!  Output !  An image showing what the camera would see.

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 4

What we will do….

!  Program a ray tracer from scratch !  General flow of programming assignments

1.  Simple ray casting with global geometry 2.  Geometric generality – relative placement 3.  Illumination and surface reflectance 4.  Multi-bounce tracing with reflection/refraction

!  Each assignment builds on the one before !  20 – 30 hours each

!  Following good software practices 8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 5

In the Process …

!  Study computational geometry ! Dot (i.e. inner) products (of vectors) ! Cross products (of vectors) ! Homogeneous coordinates !  Affine & perspective transformations ! Matrix multiplication ! Orthonormal matrices

!  Expertise of value beyond Graphics !

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 6

… 3-D geometric intuition …

!  Expertise requires three things. !  Linear algebra objects and operations !  Visual intuition – “seeing” what your specifying ! Quick and easy shifting back and forth

!  Most obvious examples. ! Move the camera back a bit !  Place object A on top of object B ! ….

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 7

… and of course also …

!  Learn about light ! Color spaces ! Reflection & refraction

!  Surface properties !  Lambertian (Matte) reflection !  Specular reflection ! Hybrid reflection models

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 8

Resources (1)

!  Lectures – very important ! General concepts !  Illustrative Examples

!  Textbook – reference ! Details generally presented in a clear

exposition.

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 9

Resources – Public Website

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 10

Resources (3)

!  Private Website – RamCT

!  Discussions, online notes and quizzes !  Assignments, lectures & outside pointers.

!  Office hours ! Don’t be a stranger!

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 11

More about the Textbook

Adopted in 2011 at CSU !  Virtues

! Up-to-date !  Focuses on Ray Tracing ! Consistent terminology !  Well staged mathematics

!  Downside !  Expensive

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 12

ISBN 978-1-56881-469-8

Course Rules

!  Be on time !  Class starts at 3:30

!  Ask & Answer questions !  Always give your name in the process

!  Professional behavior at all times !  No non-course related chatter !  Cell phones on silent

!  Leave the room to answer them

!  Be polite & respect others 8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 13

Major Activities / Grading

!  Quizzes, Notes, Participation !  Term Paper (this is a CS Capstone Course) !  Programming Projects (likely 5, maybe 4) !  Midterms (2) !  Final exam !  % of grade appears in the Syllabus

! … and we will look there today.

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 14

Policies

!  Assigned work is done alone !  No joint projects !  No open note exams !  No taking code from the internet !  Follow the department academic integrity policy

!  All work done on time !  Programming: 48 hour grace, 10% penalty !  When given two (or three) weeks, start right away!

!  Exceptions: unforeseeable circumstances

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 15

Systems and Tools

You may be surprised … !  You will not learn a complex and/or arcane

API to a giant graph package. !  Instead, you will build your ray tracer

largely from scratch in C or C++ or Java You may ask why no OpenGL / Active X /… !  … and I’ll give a first answer now.

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 16

Systems - Requirements

!  Mechanics

! Must run on CS Linux Machines

!  Tools for viewing models will be provided

!  Tools for viewing images will be provided

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 17

The Pelican

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 18

The person with the pelican speaks next. Why? •  One-way lectures suffer many flaws. •  Instructor can become detached. •  Students less engaged. •  Practice speaking is valuable. Why the Pelican? •  Same people always speaking. •  Knowing when your up next.

New This Year

!  The return of 2D drawing basics. !  HTML5 and the Drawing Canvas. !  Bad news …

!  You will be asked to learn about JavaScript. !  Good news …

!  You will be asked to learn about JavaScript. !  Best news …

!  Simple universal event driven 2D graphics.

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 19

Example of Tools Available

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 20

Now … Image formation Let us walk quickly through some of the key concepts of this course as a means of setting up a context for what is to come.

Into The Substance

What is an image?

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 22

What is an image? (cont)

!  An array of values !  Intensities (if gray scale) !  Triples of red, green & blue

(color)

!  This image is a part of the previous image ! Where?

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 23

How is an image formed?

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 24

Step 1: Light Source

!  Lights Sources have !  Intensities ! Color !  Positions

!  Bonus: atmospheric effects

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 25

Step 2: Reflection

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 26

Step 3: Projection

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 27

How (artificial) images are formed

Light Source

Geometric Objects

Sensor Coordinate System

28 ©J. Ross Beveridge & Bruce A. Draper 2014 8/26/14

Now mimic light…

From source to object to sensor

8/26/14 29 ©J. Ross Beveridge & Bruce A. Draper 2014

… or …

…from source to object to object to sensor 8/26/14 30 ©J. Ross Beveridge & Bruce A. Draper 2014

… or …

…you get the point. 8/26/14 31 ©J. Ross Beveridge & Bruce A. Draper 2014

True – But Backwards!

!  Light sources emit a LOT of light rays !  Most of them never strike your camera

!  And you might have multiple light sources !  In fact, you usually do, and the light intermingles

!  So following every light ray is expensive

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 32

So instead, work backwards: start at the surface of the lens, and figure out where the light came from … all the way back to the light source.

In other words

8/26/14 33 ©J. Ross Beveridge & Bruce A. Draper 2014

What can this approach do?

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 34

A photorealistic rendered image created by using POV-Ray 3.6 Image from Wikipedia entry on rendering.

What skills will we need?

!  Lots of Math !  Linear Algebra (Matrices, Vectors, Dot Products) ! Discrete representations (Images)

!  A little Physics !  Lighting/Energy Transfer ! Color reflections/refraction

!  A little Mechanical Engineering ! CAD/CAM, Solid Models

!  A whole bunch of Computer Science 8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 35

What do I expect?

!  Familiarity with vectors and matrices ! Mechanics, e.g. multiplication !  Basic ideas (perhaps rusty)

!  Programming ability !  You know how to design, implement & test

thousand line plus programs !  Willingness to work (hard)

8/26/14 36 ©J. Ross Beveridge & Bruce A. Draper 2014

Quick Who Does What?

!  I will describe graphics principles ! Mathematics (e.g. projection) !  Physics (e.g. reflections)

!  We will discuss/practice concepts. !  We will fill out lecture notes. !  You will convert ideas into code.

8/26/14 37 ©J. Ross Beveridge & Bruce A. Draper 2014

Term Paper Topic Check-in

!  The first major assignment is a term paper.

!  Please login and enter below: !  Your name, first name followed by last name

!  your proposed term paper title, …

! … a one sentence description of your topic.

!  Avoid topics already listed. !  That means advantage to the swift.

8/26/14 ©J. Ross Beveridge & Bruce A. Draper 2014 38