Computer Graphics Inf4/MSc Computer Graphics Lecture 8 Transparency, Mirroring.
Lecture 1. Overview of Computer Graphics
Transcript of Lecture 1. Overview of Computer Graphics
![Page 1: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/1.jpg)
CS171 Computer Graphics
Time: 3pm-3:55pm MW(F) - Location: Annenberg 105 - Text: Mostly Self-Contained on course Web pages
Instructor: - Al Barr [email protected],
TAs: - Kevin (Kevli) Li - [email protected] - Nailen Matschke [email protected] - Parker Won [email protected] - Kevin Yuh [email protected] - Andrew Zhao [email protected]
![Page 2: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/2.jpg)
Today’s Topics
Introduction, Definition of Computer Graphics Course Syllabus, Structure of Assignments Examples
- Geometric Modeling - Physically-based Modeling - Rendering - Human-Computer Interaction …
![Page 3: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/3.jpg)
What is Computer Graphics?
… Using computers to construct models and turn them into images …
Models
Images
Computer(s) Computational and Mathematical Model
Representations
![Page 4: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/4.jpg)
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.
![Page 5: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/5.jpg)
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
![Page 6: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/6.jpg)
Examples of Rendered Models
Fur “Texels” for light ray probability distributions
“Dynamic constraints” to hold chain links together and do physics
![Page 7: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/7.jpg)
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
![Page 8: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/8.jpg)
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
![Page 9: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/9.jpg)
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
![Page 10: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/10.jpg)
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.
![Page 11: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/11.jpg)
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
![Page 12: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/12.jpg)
Ray Tracing, continued
HW 7 Image (2014) by David Warrick
![Page 13: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/13.jpg)
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”
![Page 14: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/14.jpg)
![Page 15: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/15.jpg)
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
![Page 16: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/16.jpg)
![Page 17: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/17.jpg)
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
![Page 18: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/18.jpg)
![Page 19: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/19.jpg)
Original Smoothed
![Page 20: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/20.jpg)
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)
![Page 21: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/21.jpg)
Real-time Flexible sheets
Mathieu Desbrun et al, CGI 99, uses inverse Euler and angular momentum correction – see demo on Responsive Workbench
![Page 22: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/22.jpg)
Old
New Old
New
Finding Global contact points
![Page 23: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/23.jpg)
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.
![Page 24: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/24.jpg)
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
![Page 25: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/25.jpg)
Example: PBM Language enables Model Extraction Pipeline
![Page 26: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/26.jpg)
![Page 27: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/27.jpg)
![Page 28: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/28.jpg)
![Page 29: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/29.jpg)
![Page 30: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/30.jpg)
![Page 31: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/31.jpg)
![Page 32: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/32.jpg)
![Page 33: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/33.jpg)
![Page 34: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/34.jpg)
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***
![Page 35: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/35.jpg)
OpenGL Overview
per vertex operations & primitive assembly
Rasterization per pixel operations
Frame Buffer
Commands or display list
![Page 36: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/36.jpg)
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
![Page 37: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/37.jpg)
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
![Page 38: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/38.jpg)
Basic Mathematical Types
Scalars: s (a real number) Column Vectors: Rep of 3D Points:
Column Vectors: Rep of 3D Directions:
zyx
zyx
![Page 39: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/39.jpg)
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 …
![Page 40: Lecture 1. Overview of Computer Graphics](https://reader033.fdocuments.us/reader033/viewer/2022051711/5868c4da1a28ab63408bfea4/html5/thumbnails/40.jpg)
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 …