Lecture 1. Overview of Computer Graphics

Preview:

Citation preview

CS171 Computer Graphics

Time: 3pm-3:55pm MW(F) - Location: Annenberg 105 - Text: Mostly Self-Contained on course Web pages

Instructor: - Al Barr barradmin@cs.caltech.edu,

TAs: - Kevin (Kevli) Li - kevli@caltech.edu - Nailen Matschke nailen@caltech.edu - Parker Won pwon111@gmail.com - Kevin Yuh kyuh@caltech.edu - Andrew Zhao azhao@caltech.edu

Today’s Topics

Introduction, Definition of Computer Graphics Course Syllabus, Structure of Assignments Examples

- Geometric Modeling - Physically-based Modeling - Rendering - Human-Computer Interaction …

What is Computer Graphics?

… Using computers to construct models and turn them into images …

Models

Images

Computer(s) Computational and Mathematical Model

Representations

Main Areas in Computer Graphics

Modeling – making mathematical representations of objects - e.g., Geometric models - Physical/Newtonian models, Collision models, etc. - Scientific simulation methods (molecular biology, weather, etc.)

Rendering – making images from these representations - Vector images (the oldest CG days, line drawings on paper, pen-plots,

or in analog displays on a radar screen CRT) - Raster images (color images made out of PIXELS) - Stereo images, etc. (one image per eye, etc.) Interaction –

- human /computer, gestural, verbal, comunication methods from humans to computers and back, also human-to-human with computer intermediary, etc.

Computer Graphics

Computer graphics: - Modeling (representations of things) - Rendering, (images of things) - Simulation, - Scientific visualization, and

human/computer interaction. Uses mathematical principles, eg

differential geometry, constrained optimization, integral equations; Physical principles, eg, mechanics

of solids, physics of light. Emphasizes correct underlying

mathematics and on careful realization in efficient, provably robust algorithms

Examples of Rendered Models

Fur “Texels” for light ray probability distributions

“Dynamic constraints” to hold chain links together and do physics

Tentative Course Topics

Introduction and 3D Geometry. Rotation. 4x4 transforms, etc. Intro to Surface Representations (Polygonal, Parametric, Implicit) OpenGL and Event Programming Intro to Visibility, Rasterization Shading, Lighting calculations Ray Tracing Texture Mapping methods Anti-Aliasing, Linear Filtering Theory Quaternions, Dual Quaternions Intro. Animation, Inverse Kinematics GPU Digital filtering

Structure of Assignments

Nine (or so) Assignments, generally due Wed 3pm - See web site, http://courses.cms.caltech.edu/cs171/ - click on Assignments (assignments and policies still being updated)

Assignment 0: relatively straightforward mini-assignment - Setting up the OpenGL development environment, Getting familiar

with using parsers and the C++ Matrix Library Eigen, Outputting images in the Portable Pixel Map (PPM) format

Assignment 1: 3D Wireframe Renderer - Covers 4x4 Geometric Transformations (Translation, Rotation, and

Scaling), World and Camera Coordinate Spaces, Perspective Projection and Normalized Device Coordinates (NDC), Line Rasterization using Bresenham's Line Drawing Algorithm

Assignment 2: 3D Shaded Surface Renderer, - builds on Assignment 1 to render 3D shaded surfaces based on file

input. Covers Triangle Rasterization and Interpolation using Barycentric Coordinates, Surface Normals, Ambient, Diffuse, and Specular Reflections, Lighting Attenuation, Phong Reflection Model (also known as the “standard” Lighting Model), Depth Buffering, Backface Culling, Gouraud and Flat Shading Algorithms

Assignment 3: Intro to OpenGL - You recreate the 3D shaded surface renderer program from

Assignment 2 using OpenGL; add arcball mouse interface. - Covers OpenGL Syntax and Functionality, Arcball Mouse User

Interface

Assignment 4: Animation (To be out) - Two animation programs: one using physics and one using keyframe

interpolation. Covers Time Integrators, Symplecticity, part of Lagrangian Mechanics, The Discrete Lagrangian Integrator, Keyframes, Cubic Splines, Cardinal and Catmull-Rom Splines,Quaternions, Spherical Linear Interpolation (Slerp)

Assignment 5: Meshing and Texturing (To be out) - Render bump mapped textured meshes. Covers Half-Edge Mesh Data

Structure, Texture Mapping and Mipmapping, Surface Normal Computations for Meshes, Bump Mapping

Assignment 6: Ray Tracing (To be out) - Geometric Optics, Shadowing, Reflection, Refraction, alg speedups.

Ray Tracing, HW 6,7

Pinhole Camera algorithm to trace computational light rays “in reverse time” – shadows, reflections, refractions in one method

Images by Al Barr, 1981, Ray Tracing Superquadrics

Ray Tracing, continued

HW 7 Image (2014) by David Warrick

3D Geometry and Physics

Need reliable ways to represent and “run” the model Geometry, movement and configuration of modeled items, cameras, etc. Everything that’s needed for object color, texture, camera motion, etc. Physical interaction properties if objects are supposed to be “physical”

like billiards

Requires a powerful computational approach to scoped Language tools for time dependent shape representation, interaction, etc., also needs very robust mathematical methods.

Many parts of computer graphics involve efforts using Parsers in

line with the need for “Languages”

Inspired by common foundation for Mechanical, Biological simulation

A source of motivation, long term goal for some of the research: the creation of tools for simulation and behavioral prediction of mechanical and biophysical structures

Implicit Fairing of Surface Meshes

Mathieu Desbrun et al, Siggraph 99 Improved set of “parameterization independent” Curvature

flow and Laplacian smoothing operators

Original Previous New

Original Smoothed

Interactive-speed Physical Simulations

Real-time flexible sheets w/ collision and contact constraints implemented on Responsive Workbench Developing methods for combining sheets and real-time

deformable volumes with real-time articulated rigid bodies, with body-body contact constraints. (See Billiards demo, also Flexible demo)

Real-time Flexible sheets

Mathieu Desbrun et al, CGI 99, uses inverse Euler and angular momentum correction – see demo on Responsive Workbench

Old

New Old

New

Finding Global contact points

Level Set methods for Computer Graphics

Representing surface shapes with implicit functions f(x) = 0 3D level-set morphing method that allows topology changes Research for using volumes as ‘first-rate’ modeling

primitives.

Long Term Goals for Physically Based Modeling

Develop robust mathematical methods and a PBM “language”; imitate success of 2D languages used for printing, but for 3D mechanics. Enable nonexpert people to reliably specify, design, control and build

computational models of physical systems of rigid, flexible, and fluid objects. Make PBM and rapid simulation a key enabling technology for Virtual

Engineering, Biological Simulation, Mechanical Simulation, Manufacturing New methods to create, modify, and represent increasingly complex and/or

realistic models. Modeling research augments research in rendering, interaction,

visualization and performance

Example: PBM Language enables Model Extraction Pipeline

OpenGL

OpenGL is a low-level graphics API (C/C++ library) -API= Application Program Interface: routines, protocols, and tools for building software applications. - A good API makes it easier to develop a program by providing all the needed building blocks.

Window system independent, but Has no facility for window events/user input. Use other libraries for interaction (eg. GLUT)

Vertex driven Geometric “Primitives” assembled from vertices

***OpenGL creates/runs a state machine***

OpenGL Overview

per vertex operations & primitive assembly

Rasterization per pixel operations

Frame Buffer

Commands or display list

Clearing the Buffers

Clears the buffers using the specified values glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) glClear(GLbitfield mask)

Masks: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_ACCUM_BUFFER_BIT, GL_STENCIL_BUFFER_BIT

Drawing Primitives

Begin/End drawing a primitive

glBegin(GLenum mode) glEnd()

Modes:

GL_POINTS, GL_LINES, GL_TRIANGLES, GL_TRIANGLE_STRIP, GL_QUADS, GL_POLYGON

Basic Mathematical Types

Scalars: s (a real number) Column Vectors: Rep of 3D Points:

Column Vectors: Rep of 3D Directions:

zyx

zyx

Math Types, continued

Matrices (3x3 rotation, 4x4 transformation) We will be using Eigen – see HW 0 to set up environment.

Higher order Tensors

- Tensors can be defined as the abstract geometric mathematical objects that are Linear

- 0th order tensors are scalars, 1st order are vectors, 2nd order are matrices, etc

- 3-D tensors of order N are represented with 3n components …

Summary

Covered intro to Computer Graphics - Modeling, Rendering and Interaction - Need reliable mathematics and algorithms to implement these

Touched on several course topics Gave several examples …

Recommended