Computer Graphics: Programming, Problem Solving, and Visual Communication

Similar documents
Computer Graphics: Programming, Problem Solving, and Visual Communication

CHAPTER 1 Graphics Systems and Models 3

Computer Graphics: Programming, Problem Solving, and Visual Communication

Computer Graphics: Programming, Problem Solving, and Visual Communication

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

Models and Architectures

Pipeline Operations. CS 4620 Lecture 14

Course Title: Computer Graphics Course no: CSC209

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Foundations of 3D Graphics Programming

HE COMPLETE OPENGL PROGI FOR WINDOW WIND

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1

CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY CS2401 COMPUTER GRAPHICS QUESTION BANK

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Introduction to Computer Graphics with WebGL

Computer Graphics I Lecture 11

CS2401 COMPUTER GRAPHICS ANNA UNIV QUESTION BANK

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Introduction to Computer Graphics

Spring 2012 Final. CS184 - Foundations of Computer Graphics. University of California at Berkeley

CS451Real-time Rendering Pipeline

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

Pipeline Operations. CS 4620 Lecture 10

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.

QUESTION BANK 10CS65 : COMPUTER GRAPHICS AND VISUALIZATION

Topics and things to know about them:

CSE4030 Introduction to Computer Graphics

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

Graphics and Interaction Rendering pipeline & object modelling

Deferred Rendering Due: Wednesday November 15 at 10pm

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

CS GAME PROGRAMMING Question bank

Advanced 3D Game Programming with DirectX* 10.0

Lessons from Scene Graphs: Using Scene Graphs to Teach Hierarchical Modeling

Lecture 2. Shaders, GLSL and GPGPU

CIS 581 Interactive Computer Graphics

CS 4620 Program 3: Pipeline

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

Graphics Shaders. Theory and Practice. Second Edition. Mike Bailey. Steve Cunningham. CRC Press. Taylor&FnincIs Croup tootutor London New York

Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

CIS 581 Interactive Computer Graphics (slides based on Dr. Han-Wei Shen s slides) Requirements. Reference Books. Textbook

Module 13C: Using The 3D Graphics APIs OpenGL ES

Computer Science 175. Introduction to Computer Graphics lib175 time: m/w 2:30-4:00 pm place:md g125 section times: tba

Points and lines, Line drawing algorithms. Circle generating algorithms, Midpoint circle Parallel version of these algorithms

Today s Agenda. Basic design of a graphics system. Introduction to OpenGL

Adaptive Point Cloud Rendering

I expect to interact in class with the students, so I expect students to be engaged. (no laptops, smartphones,...) (fig)

CS 464 Review. Review of Computer Graphics for Final Exam

Welcome to COMP 770 (236) Introduction. Prerequisites. Prerequisites


Overview: Ray Tracing & The Perspective Projection Pipeline

0. Introduction: What is Computer Graphics? 1. Basics of scan conversion (line drawing) 2. Representing 2D curves

3D Graphics and OpenGl. First Steps

- Location: Annenberg Text: Mostly Self-Contained on course Web pages. - Al Barr

ce Hours: MW 12:30 PM 1:30 PM (till 12/12/18), or by appointment

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

OXFORD ENGINEERING COLLEGE (NAAC Accredited with B Grade) DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING LIST OF QUESTIONS

CS 498 VR. Lecture 19-4/9/18. go.illinois.edu/vrlect19

CS4620/5620: Lecture 14 Pipeline

To Do. Computer Graphics (Fall 2008) Course Outline. Course Outline. Methodology for Lecture. Demo: Surreal (HW 3)

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

Rasterization Overview

COMP30019 Graphics and Interaction Rendering pipeline & object modelling

Lecture outline. COMP30019 Graphics and Interaction Rendering pipeline & object modelling. Introduction to modelling

OUTLINE. Learn the basic design of a graphics system Introduce pipeline architecture Examine software components for a graphics system

Cornell CS4620 Fall 2011!Lecture Kavita Bala (with previous instructors James/Marschner) Cornell CS4620 Fall 2011!Lecture 1.

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

Three Main Themes of Computer Graphics

Real-Time Rendering. Tomas Möller Eric Haines. A K Peters Natick, Massachusetts

Blue colour text questions Black colour text sample answers Red colour text further explanation or references for the sample answers

OpenGL SUPERBIBLE. Fifth Edition. Comprehensive Tutorial and Reference. Richard S. Wright, Jr. Nicholas Haemel Graham Sellers Benjamin Lipchak

CS 130 Exam I. Fall 2015

CS 130 Final. Fall 2015

The Traditional Graphics Pipeline

Introduction to Visualization and Computer Graphics

Illumination and Shading

Lecturer Athanasios Nikolaidis

Computer Graphics. Shadows

Computer Graphics. Bing-Yu Chen National Taiwan University

Tutorial on GPU Programming #2. Joong-Youn Lee Supercomputing Center, KISTI

CS 354R: Computer Game Technology

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

EF432. Introduction to spagetti and meatballs

3D Rendering Pipeline

Graphics for VEs. Ruth Aylett

The Traditional Graphics Pipeline

Level of Details in Computer Rendering

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

Spring 2009 Prof. Hyesoon Kim

CSCE 441 Computer Graphics Fall 2018

CS380: Computer Graphics Introduction. Sung-Eui Yoon ( 윤성의 ) Course URL:

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Computer Graphics 10 - Shadows

Graphics for VEs. Ruth Aylett

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Computer Graphics Lecture 11

Animation & Rendering

Transcription:

Computer Graphics: Programming, Problem Solving, and Visual Communication Dr. Steve Cunningham Computer Science Department California State University Stanislaus Turlock, CA 95382 copyright 2002, Steve Cunningham All rights reserved

These notes are a draft of a textbook for an introductory computer graphics course that emphasizes graphics programming and is intended for undergraduate students who have a sound background in programming. Its goal is to introduce fundamental concepts and processes for computer graphics, give students experience in computer graphics programming using the OpenGL application programming interface (API), and show the power of visual communication and of computer graphics in the sciences. The contents below represent a relatively mature version of these notes, although some reorganization of the material is still expected and some additional topics may be developed. We hope you will find these notes to be helpful in learning computer graphics and encourage you to give us feedback with the feedback pages at the end of the notes. CONTENTS: Getting Started What is a graphics API? Overview of the book What is computer graphics? The 3D Graphics Pipeline - 3D model coordinate systems - 3D world coordinate system - 3D eye coordinate system - Clipping - Projections - 2D eye coordinates - 2D screen coordinates - Overall viewing process - Different implementation, same result - Summary of viewing advantages A basic OpenGL program - The structure of the main() program using OpenGL - Model space - Modeling transformation - 3D world space - Viewing transformation - 3D eye space - Projections - 2D eye space - 2D screen space - Another way to see the program OpenGL extensions Chapter 1: Viewing and Projection Fundamental model of viewing - Setting up the viewing environment - Defining the projection - View volumes - Calculating the perspective transformation - Defining the window and viewport Some aspects of managing the view - Hidden surfaces 3/24/02 Page 2

- Double buffering - Clipping planes Stereo viewing Implementation of viewing and projection in OpenGL - Defining a window and viewport - Reshaping the window - Defining a viewing environment - Defining perspective projection - Defining an orthogonal projection - Managing hidden surface viewing - Setting double buffering - Defining clipping planes Implementing a stereo view Questions Chapter 2: Principles of Modeling Simple Geometric Modeling - Point and points - Line segments - Connected lines - Triangle - Sequence of triangles - Quadrilateral - Sequence of quads - General polygon - Polyhedron - Aliasing and antialiasing - Normals - Data structures to hold objects - Additional sources of graphic objects - A word to the wise Transformations and modeling - Transformations - Composite transformations - Transformation stacks and their manipulation - Compiling geometry Scene graphs and modeling graphs A brief summary of scene graphs - An example of modeling with a scene graph The viewing transformation The scene graph and depth testing Using the modeling graph for coding - Example - Using standard objects to create more complex scenes 3/24/02 Page 3

Questions Chapter 3: Implementing Modeling in OpenGL The OpenGL model for specifying geometry - Point and points mode - Line segments - Line strips - Line loops - Triangle - Sequence of triangles - Quads - Quad strips - General polygon - Antialiasing - The cube we will use in many examples Additional objects with the OpenGL toolkits - GLU quadric objects > GLU cylinder > GLU disk > GLU sphere - The GLUT objects - An example Transformations in OpenGL Code examples for transformations - Simple transformations - Transformation stacks - Inverting the eyepoint transformation - Creating display lists Chapter 4: Mathematics for Modeling Coordinate systems and points Points, lines, and line segments Distance from a point to a line Line segments and parametric curves Vectors Dot and cross products of vectors Reflection vectors Transformations Planes and half-spaces Distance from a point to a plane Polygons and convexity Polyhedra Collision detection Polar, cylindrical, and spherical coordinates Higher dimensions? Chapter 5: Color and Blending - The RGB cube - Luminance 3/24/02 Page 4

- Other color models - Color depth - Color gamut - Color blending with the alpha channel - Challenges in blending - Modeling transparency with blending - Indexed color - Using color to create 3D images - An object with partially transparent faces Color in OpenGL - Enabling blending Code examples - A model with parts having a full spectrum of colors - The HSV cone - The HLS double cone - An object with partially transparent faces Questions Chapter 6: Visual Communication General issues in visual communication - Use appropriate representation for your information - Keep your images focused - Use appropriate presentation levels for your information - Use appropriate forms for your information - Be very careful to be accurate with your information - Understand and respect the cultural context of your audience - Make your interactions reflect familiar and comfortable relationships between cause and effect Shape - Comparing shape and color encodings Color - Emphasis colors - Background colors - Color deficiencies in audiencd - Naturalistic color - Pseudocolor and color ramps - Implementing color ramps - Using color ramps - To light or not to light - Higher dimensions Dimensions Image context - Choosing an appropriate view - Legends to help communicate your encodings - Labels to help communicate your problem Motion - Leaving traces of motion - Motion blurring Interactions 3/24/02 Page 5

Cultural context of the audience Accuracy Output media Implementing some of these ideas in OpenGL - Using color ramps - Legends and labels - Creating traces - Using the accumulation buffer Chapter 7: Graphical Problem Solving in Science Examples Diffusion - Temperatures in a bar - Spread of disease Function graphing and applications Parametric curves and surfaces Graphical objects that are the results of limit processes Scalar fields Representation of objects and behaviors - Gas laws and diffusion principles - Molecular display - Monte Carlo modeling process 4D graphing - Volume data - Vector fields Graphing in higher dimensions Data-driven graphics Code examples - Diffusion - Function graphing - Parametric curves and surfaces - Limit processes - Scalar fields - Representation of objects and behaviors - Molecular display - Monte Carlo modeling - 4D graphing - Higher dimensional graphing - Data-driven graphics Credits Chapter 8: The Rendering Pipeline The pipeline The rendering pipeline for OpenGL - Texture mapping in the rendering pipeline - Per-fragment operations - Some extensions to OpenGL - An implementation of the rendering pipeline in a graphics card The rasterization process 3/24/02 Page 6

Chapter 9: Lighting and Shading Lighting - Ambient, diffuse, and specular light - Surface normals Light properties - Positional lights - Spotlights - Attenuation - Directional lights - Positional and moving lights Materials Shading - Flat shading - Smooth shading Examples of flat and smooth shading Calculating per-vertex normals - Averaging polygon normals - Analytic computations Other shading models - Vertex and pixel shaders Global Illumination Local Illumination Lights and materials in OpenGL - Specifying and defining lights - Defining materials - Setting up a scene to use lighting - Using GLU quadric objects - An example: lights of all three primary colors applied to a white surface - Code for the example - Shading example Questions Chapter 10: Event Handling of events - keypress events - mouse events - menu events - window events - system events - software events The vocabulary of interaction Events in OpenGL Callback registering Some details Code examples - Idle event callback 3/24/02 Page 7

- Keyboard callback - Menu callback - Mouse callback for object selection - Mouse callback for mouse motion The MUI (Micro User Interface) Facility - Menu bars - Buttons - Radio buttons - Text boxes - Horizontal sliders - Vertical sliders - Text labels Using the MUI functionality Installing MUI for Windows Chapter 11: Texture Mapping - 1D texture maps - 2D texture maps - 3D texture maps - Associating a vertex with a texture point - The relation between the color of the object and the color of the texture map - Other meanings for texture maps Creating a texture map - Getting an image as a texture map - Generating a synthetic texture map Texture mapping and billboards Interpolation for texture maps Antialiasing in texturing MIP mapping Multitexturing Using billboards Texture mapping in OpenGL - Associating vertices and texture points - Capturing a texture from the screen - Texture environment - Texture parameters - Getting and defining a texture map - Texture coordinate control - Texture interpolation - Texture mapping and GLU quadrics - The Chromadepth process - Using 2D texture maps to add interest to a surface - Environment maps Code examples - A 1D color ramp - An image on a surface 3/24/02 Page 8

- An environment map - Multitexturing code Questions Chapter 12: Dynamics and Animation Keyframe animation - Temporal aliasing - Building an animation - Moving objects in your model - Moving parts of objects in your model - Moving the eye point or the view frame in your model - Changing features of your models Some points to consider when doing animations with OpenGL Code examples Chapter 13: High-Performance Graphics Techniques Techniques - Hardware avoidance - Designing out visible polygons - Culling polygons - Avoiding depth comparisons - Front-to-back drawing - Binary space partitioning - Clever use of textures - System speedups - Level of detail - Reducing lighting computation - Fog - Collision detection Chapter 14: Object Selection Picking in OpenGL Making picking work The pick matrix Using the back color buffer to do picking A selection example Questions Chapter 15: Interpolation and Spline Modeling - Interpolations 3/24/02 Page 9

- Extending interpolations to more control points Interpolations in OpenGL - Automatic normal and texture generation with evaluators - Additional techniques - Spline curves - Spline surfaces Chapter 16: Per-Pixel Operations Ray casting Ray tracing Ray tracing and global illumination Volume rendering Fractal images Iterated function systems Per-pixel operations supported by OpenGL Chapter 17: Hardcopy - Digital images - Print - Film - Video - Digital video - 3D object prototyping - The STL file Appendices Appendix I: PDB file format Appendix II: CTL file format Appendix III: STL file format References and Resources References Resources Evaluation Instructor s evaluation Student s evaluation 3/24/02 Page 10

Because this is a draft of a textbook for an introductory, API-based computer graphics course, the author recognizes that there may be some inaccuracies, incompleteness, or clumsiness in the presentation and apologizes for these in advance. Further development of these materials, as well as source code for many projects and additional examples, is ongoing continuously. All such materials will be posted as they are ready on the author s Web site: http://www.cs.csustan.edu/~rsc/nsf/ Your comments and suggestions will be very helpful in making these materials as useful as possible and are solicited; please contact Steve Cunningham California State University Stanislaus rsc@cs.csustan.edu This work was supported by National Science Foundation grant DUE-9950121. All opinions, findings, conclusions, and recommendations in this work are those of the author and do not necessarily reflect the views of the National Science Foundation. The author also gratefully acknowledges sabbatical support from California State University Stanislaus and thanks the San Diego Supercomputer Center, most particularly Dr. Michael J. Bailey, for hosting this work and for providing significant assistance with both visualization and science content. Ken Brown, a student of the author s, provided invaluable and muchappreciated assistance with several figures and concepts in this manuscript. The author also thanks students Ben Eadington, Jordan Maynard, and Virginia Muncy for their contributions through examples, and a number of others for valuable conversations and suggestions on these notes. 3/24/02 Page 11