CS 559: Computer Graphics Prof Stephen Chenney Fall 2002 http://www.cs.wisc.edu/~cs559-1 09/03/02 © 2002 University of Wisconsin Today • Course overview and information • Getting started on images • Programming assignment 1 (off class home page) 09/03/02 © 2002 University of Wisconsin What is Computer Graphics? • Technically, it’s about the production, manipulation and display of images using computers • Practically, it’s about movies, games, art, training, advertising, communication, design, … 09/03/02 © 2002 University of Wisconsin Is 2D Graphics Important? Compositing in movies: images are created in layers, and then combined 09/03/02 Sprites in games: Images are built by overlaying characters and objects on a background © 2002 University of Wisconsin 3D is Sometimes Essential Virtual Reality Augmented Reality Iowa Driving Simulator http://www.nads-sc.uiowa.edu/ W. Eric L.Grimson at MIT 09/03/02 http://www.ai.mit.edu/projects/medicalvision/surgery/surgical_navigation.html © 2002 University of Wisconsin Computer Graphics? The Wooden Mirror, by Daniel Rozin It consists of many small wooden blocks with a camera in the center. The camera takes an image, it is converted to intensities, and each block is rotated to reflect an appropriate amount of light. 09/03/02 © 2002 University of Wisconsin This Course: Building Blocks • Images and computers – Sampling, Color, Filters, … • Drawing in 2D – Drawing lines and polygons, clipping, transformations • Drawing in 3D – Viewing, transformations, lighting, the standard pipeline • Modeling in 3D – Describing volumes and surfaces, drawing them effectively • Miscellaneous interesting stuff – Raytracing, animation, … 09/03/02 © 2002 University of Wisconsin People • Prof. Stephen Chenney – Room 6387 – Office Hours Tues 2-3, Thurs 11-12 – schenney@cs.wisc.edu • TA: Matt Allen – Office Hour TBD – matthew@cs.wisc.edu • TA: David Gekiere – Office hours TBD – gekiere@cs.wisc.edu Send all class email to cs559-1@cs It is read by both Prof Chenney and the TAs and gets the fastest response 09/03/02 © 2002 University of Wisconsin Web and Email • The class web site is http://www.cs.wisc.edu/~cs559-1 – – – – It is updated very frequently Lecture notes are put online before class, and updated after class Additional resources and links are provided Reading for future classes is listed • The class mailing list is cs559-1list@cs.wisc.edu – I assume that you check this email regularly – All notices are sent out on the mailing list, including things not mentioned in class – The mail goes to your cs class account, so make sure you check that or set up forwarding 09/03/02 © 2002 University of Wisconsin Textbooks and Reader • Peter Shirley, “Fundamentals of Computer Graphics”, A.K. Peters, 2002 • Woo et. al., "OpenGL Programming Guide", Third Edition, Adison-Wesley, 1999 – The definitive guide to OpenGL, and a reasonable description of general real-time 3D graphics • Class reader: Available at DOIT – A collection of papers, textbook chapters, and other documents – Some essential material not contained in the textbook 09/03/02 © 2002 University of Wisconsin Projects • There will be three projects for the course, spread evenly through the semester • Project 1: Image editing • Project 2: Running a maze • Project 3: Building a virtual theme park • You must submit all three in order to pass the course 09/03/02 © 2002 University of Wisconsin Homeworks • There will be a homework every two weeks or so • They are intended primarily to explore topics further and to prepare you for the exams • They will be graded, but only the best five will count • Some essential techniques will be presented only in homework – For example, an review of linear algebra 09/03/02 © 2002 University of Wisconsin Grading (approximate) • • • • • 45% Midterm and Final 45% Projects 10% Homework Everyone must write up their own homework For the projects, you have the option of working in pairs 09/03/02 © 2002 University of Wisconsin Lab Facilities • Room B240 contains machines for use in this class • They have high performance hardware and the software to make it work • Students in CS 559 have priority in the lab, but it shouldn’t be a problem • Don’t underestimate the benefits of working in a lab with your classmates – For instance, the blackboards frequently display useful hints • But they also sometimes have incorrect information!! 09/03/02 © 2002 University of Wisconsin Software Infrastructure • FLTK will be the user interface toolkit – Provides windows, buttons, menus, etc – C++ class library, completely portable – We are currently at version 1.1.0rc6, available for free: www.fltk.org • OpenGL will be the 3D rendering toolkit – Provides an API for drawing objects specified in 3D – Included as part of Windows, available for Linux either as Mesa (software) or hardware drivers • Visual C++ 6.0 will be the programming environment for grading • To be graded, your projects must compile under Visual C++ on the machines in room B240 09/03/02 © 2002 University of Wisconsin C++ • This is probably the first, and only, class in which you must complete large software projects in C++ without step by step instructions • There is a great deal of freedom in the projects, which requires that you do your own software design • If you are not comfortable in C++, you will have to take action • There are tutorials intended to teach you C++ assuming you know Java: – http://www.cs.wisc.edu/~hasti/cs368/CppTutorial/index.html – These are intended for the course CS 368, but just do the tutorials • The transition to C++ was one of the biggest issues for past CS559 students 09/03/02 © 2002 University of Wisconsin Adding the Class • To go on the waiting list, email schenney@cs.wisc.edu with your name, ID and major • Do it again even if you have already send me email • People who add in this manner will have to wait a couple of days for accounts 09/03/02 © 2002 University of Wisconsin Programming Assignment 1 • • • • Do the Visual C++ and FLTK demo off the class web page Will get you started with C++ and FLTK Do it NOW, don’t wait until the project comes up There will be another assignment in a week or so continuing your preparation for the first project • Not graded. Questions during office hours or on the class mailing list 09/03/02 © 2002 University of Wisconsin Images • Information presented in a flat (2D) format to be examined visually • We are familiar with many forms of image: – – – – – Photographs Paintings Sketches Television Computer screens • Each form has its own way of obtaining and storing the information content 09/03/02 © 2002 University of Wisconsin Digital Images • Images can be stored on a computer in one of many forms • There are some conflicting goals: – – – – The storage cost should be minimized The amount of information stored should be maximized It should be easy to perform editing operations Tracking copyrights may be important • There are two abstract types of digital images: Raster images and Vector images 09/03/02 © 2002 University of Wisconsin Raster Images • A raster is a regular grid of pixels (picture elements) • Raster image formats store the intensity (brightness) and color information at each pixel – Simplest is to use a 2D array of pixel values – Some formats store the pixel information in very different ways • A 6x3 image • Aspect ratio is width/height, 2 09/03/02 © 2002 University of Wisconsin Vector Images • Store images as collections of geometric primitives – E.g. Lines, polygons, circles, … • Called vector images for historical reasons • Postscript (PDF) is the most famous vector image format • It is possible to go from a vector image to a raster image • It is very hard to go the other way 09/03/02 © 2002 University of Wisconsin Obtaining Digital Images • What are some methods for obtaining a digital image? 09/03/02 © 2002 University of Wisconsin Obtaining Digital Images • What are some methods for obtaining a digital image? – – – – – – – – 09/03/02 Digital camera Scanning another image Medical scanning Editing existing digital images Paint or drawing programs Created from abstract data (e.g. math function plot) Rendered from a scene description … © 2002 University of Wisconsin Displaying Images • Display is not the same as storage – A monitor displays an image, but does not store it – The same image may look different on different monitors • Typically, the display is taken into account when creating images, but not always • Different display techniques have very different properties • What are some common display techniques? 09/03/02 © 2002 University of Wisconsin Displaying Images • What are some common display techniques? – – – – – – – 09/03/02 Cathode Ray Tube (CRT): Computer monitor / Television Liquid Crystal Display (LCDs) Printing: many variations Vector displays Holographic displays Plasma displays … © 2002 University of Wisconsin Trade-Offs • Which is preferred: Raster or Vector? – – – – – For display on an LCD? For display on a plotter (a printer that draws lines with pens)? For images from digital cameras? For CAD (Computer Aided Design)? For high-quality text? • Which is easier to: – Resize? – Rotate? – Crop? 09/03/02 © 2002 University of Wisconsin Trade-Offs • Which is preferred: Raster or Vector? – – – – – For display on an LCD? Raster For display on a plotter (a printer that draws lines with pens)? Vector For images from digital cameras? Raster For CAD (Computer Aided Design)? Vector For high-quality text? Vector • Which is easier to: – Resize? Vector – Rotate? Vector – Crop? Raster 09/03/02 © 2002 University of Wisconsin Next Time • We focus on raster images • Some human perception stuff (always fun) 09/03/02 © 2002 University of Wisconsin