3D GRAPHICS. design. animate. render

Similar documents
Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

CS451Real-time Rendering Pipeline

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

Computer Graphics I Lecture 11

Graphics Pipeline 2D Geometric Transformations

Last week. Machiraju/Zhang/Möller

CIS 581 Interactive Computer Graphics

Last week. Machiraju/Zhang/Möller/Fuhrmann

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

IMAGE-BASED RENDERING AND ANIMATION

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

GEOMETRIC TRANSFORMATIONS AND VIEWING

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

Overview. By end of the week:

Rasterization Overview

Lahore University of Management Sciences. CS 452 Computer Graphics

Basic Elements. Geometry is the study of the relationships among objects in an n-dimensional space

Animation & Rendering

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

CHAPTER 1 Graphics Systems and Models 3

Computer Graphics. Instructor: Oren Kapah. Office Hours: T.B.A.

Introduction to Computer Graphics. Knowledge basic concepts 2D and 3D computer graphics

Computer Graphics CS 543 Lecture 1 (Part I) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Computer Graphics Introduction. Taku Komura

3D Mathematics. Co-ordinate systems, 3D primitives and affine transformations

Lecturer Athanasios Nikolaidis

Computer Graphics. CS52 Fall computer graphics introduction 2006 fabio pellacini 1

Computer Graphics. CS52 Winter computer graphics introduction 2008 fabio pellacini 1. introduction

CS 130 Final. Fall 2015

CS 4620 Midterm, March 21, 2017

Institutionen för systemteknik

CS 464 Review. Review of Computer Graphics for Final Exam

Animation. Keyframe animation. CS4620/5620: Lecture 30. Rigid motion: the simplest deformation. Controlling shape for animation

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

EF432. Introduction to spagetti and meatballs

Computer Graphics Fundamentals. Jon Macey

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

3D Rendering Pipeline

3D Production Pipeline

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

Exercise Max. Points Total 90

Topic 0. Introduction: What Is Computer Graphics? CSC 418/2504: Computer Graphics EF432. Today s Topics. What is Computer Graphics?

CSE 167: Introduction to Computer Graphics. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

OPENGL RENDERING PIPELINE

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

CS 130 Exam I. Fall 2015

Object Representation Affine Transforms. Polygonal Representation. Polygonal Representation. Polygonal Representation of Objects

Reading. Hierarchical Modeling. Symbols and instances. Required: Angel, sections , 9.8. Optional:

Linear and Affine Transformations Coordinate Systems

Some Resources. What won t I learn? What will I learn? Topics

6.837 Introduction to Computer Graphics Quiz 2 Thursday November 20, :40-4pm One hand-written sheet of notes allowed

Geometric transformations in 3D and coordinate frames. Computer Graphics CSE 167 Lecture 3

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

Computer Graphics (CS 543) Lecture 1 (Part 1): Introduction to Computer Graphics

Luxo Jr. Plan. Team. Movies. Why Computer Graphics? Introduction to Computer Graphics. Pixar Animation Studios, 1986 Director: John Lasseter

Today. Today. Introduction. Matrices. Matrices. Computergrafik. Transformations & matrices Introduction Matrices

CS559 Computer Graphics Fall 2015

Chapter 2 A top-down approach - How to make shaded images?

Computer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping

Graphics and Interaction Rendering pipeline & object modelling

Shaders. Slide credit to Prof. Zwicker

TDA362/DIT223 Computer Graphics EXAM (Same exam for both CTH- and GU students)

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline

Course Title: Computer Graphics Course no: CSC209

COMP30019 Graphics and Interaction Rendering pipeline & object modelling

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

CS452/552; EE465/505. Geometry Transformations

CSCI-6962 Advanced Computer Graphics

Chapter 5. Projections and Rendering

Graphics for VEs. Ruth Aylett

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

Lecture 1. Computer Graphics and Systems. Tuesday, January 15, 13

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

Spring 2009 Prof. Hyesoon Kim

Graphics for VEs. Ruth Aylett

CS 354R: Computer Game Technology

Instructor. Goals. Image Synthesis Examples. Applications. Foundations of Computer Graphics. Why Study 3D Computer Graphics?

Matrix Operations with Applications in Computer Graphics

Viewing with Computers (OpenGL)

Homework #2 and #3 Due Friday, October 12 th and Friday, October 19 th

- Rasterization. Geometry. Scan Conversion. Rasterization

Spring 2011 Prof. Hyesoon Kim

EF432. Introduction to spagetti and meatballs

Graphics Programming. Computer Graphics, VT 2016 Lecture 2, Chapter 2. Fredrik Nysjö Centre for Image analysis Uppsala University

Advanced Lighting Techniques Due: Monday November 2 at 10pm

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Introduction to 3D Graphics

DRAFT: Mathematical Background for Three-Dimensional Computer Graphics. Jonathan R. Senning Gordon College

Texture mapping. Computer Graphics CSE 167 Lecture 9

Pipeline Operations. CS 4620 Lecture 14

Software Engineering. ò Look up Design Patterns. ò Code Refactoring. ò Code Documentation? ò One of the lessons to learn for good design:

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

Game Architecture. 2/19/16: Rasterization

Three Main Themes of Computer Graphics

6.837 Introduction to Computer Graphics Final Exam Tuesday, December 20, :05-12pm Two hand-written sheet of notes (4 pages) allowed 1 SSD [ /17]

Drawing in 3D (viewing, projection, and the rest of the pipeline)

The Graphics Pipeline and OpenGL I: Transformations!

CS4620/5620: Lecture 14 Pipeline

CMSC427 Final Practice v2 Fall 2017

Transcription:

3D GRAPHICS design animate render

3D animation movies Computer Graphics

Special effects Computer Graphics

Advertising Computer Graphics

Games Computer Graphics

Simulations & serious games Computer Graphics

Computer Aided Design (CAD) Computer Graphics

Architecture Computer Graphics

Virtual/augmented reality Computer Graphics

Visualization Computer Graphics

Medical imaging Computer Graphics

Computer Graphics Design 3D animation Special effects Games Simulators Visualization Tools for artists Realism Real-time

What you will learn 1. Overview of Computer Graphics (for engineering & research) Modeling : create 3D geometry Animation : move & deform Rendering : 3D scene image 2. How the basic techniques work 3. Practice with OpenGL (+Python) 4. Case studies : Practical problems How to choose & combine existing techniques (TD)

What you will not learn Mathematical bases (algebra, geometry!) Advanced CG techniques in detail Advanced Programming the Graphics Hardware (GPU) Artistic skills or Game design Use of existing software (CAD-CAM, 3D Studio Max, Maya, Photoshop, etc)

*No book required* Text books References 3D Computer Graphics (Watt, 2000) Interactive Computer Graphics (Angel & Shreiner, 20). Computer Graphics: Principles and Practices (Hughes et al. 2013) 15

Organization & overview 1.5h CTD (course & exercises) + 1.5h TP (lab) Part 1: Basic techniques 1. Modeling: geometric representations, hierarchical modeling 2. Rendering: illumination, shading, textures 3. Animation: Keyframing, skinning, collisions Part 2: Introduction to advanced methods 3 advanced courses on modeling/rendering/animation Evaluation: [0,5 Exam + 0,5 OpenGL project]

1: graphics (projective) pipeline Inputs Output? Implemented in the Graphics Hardware (real time) Used by OpenGL

Required: transformations using 4x4 matrices 1: graphics pipeline x' a b c d x y' z' = e i f j g k h l y z w m n o p w V' = M V

Required: transformations using 4x4 matrices Homogeneous coordinates Needed for projective transformations Cartesian to projective coordinates: w=1 Projective to Cartesian coordinates: divide by w 1: graphics pipeline x' a b c d x y' z' = e i f j g k h l y z w m n o p w V' = M V

sub-case: affine transformations 1: graphics pipeline Start with cartesian coordinates: w=1 Keep the last line to 1 The last matrix column enables to express translations! x' a b c d x y' z' = e i f j g k h l y z 1 0 0 0 1 1 V' = M V

Typical affine transformations Translation Scale Rotations (Euler angles)

2D example Composition of scale and translate (0,0) (1,1) Scale(2,2) (2,2) (0,0) Translate(3,1) (3,1) (5,3) Multiplication of matrices : p' = T ( S p ) = TS p TS = 1 0 3 2 0 0 0 1 1 0 2 0 = 2 0 3 0 2 1 0 0 1 0 0 1 0 0 1

TD part 1. Is the order of transformation important? (0,0) (1,1) Scale(2,2) (2,2) (0,0) Translate(3,1) (3,1) (5,3) Exercise : (T S) p =? (S T) p 2 ST = 2 1 =? 0 0 0 0 1 0 0 3 1 0 0 1 0 0 1 Draw the transformed polygon(s) using ST and TS

1. Solution: transformations not commutative!! Scale then translate : p' = T ( S p ) = TS p Translate, then scale : p' = S ( T p ) = ST p

1: graphics pipeline Inputs Output? Ok, back to our main question!

1: graphics pipeline Lets consider that we already have the input data (ignore materials and lights for now) Mesh, composed of triangle faces (v1,v2,v3) Each vertex contains 3 coords (x,y,z) defined in the local/model frame Camera, composed of 4x4 matrices (more in a few minutes) v1 = (x1,y1,z1) v2 = (x2,y2,z2) (more in next lecture)

1: graphics pipeline Lets consider that we already have the input data (ignore materials and lights for now) Mesh, composed of triangle faces (v1,v2,v3) Each vertex contains 3 coords (x,y,z) defined in the local/model frame Camera, composed of 4x4 matrices (more in a few minutes) v1 = (x1,y1,z1) v2 = (x2,y2,z2) (more in next lecture) Creating an image from these data can be done in 4 steps!

1: graphics pipeline 1. Project geometry onto the screen frame

1: graphics pipeline 1. Project geometry onto the screen frame From model to world space (4x4 matrix) http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/

1: graphics pipeline 1. Project geometry onto the screen frame From model to world space (4x4 matrix) From world to camera space (4x4 matrix) http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/

1: graphics pipeline 1. Project geometry onto the screen frame From model to world space (4x4 matrix) From world to camera space (4x4 matrix) From camera to screen space (4x4 matrix) 1,1,1 http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/ -1,-1,-1

1: graphics pipeline 1. Project geometry onto the screen frame From model to world space (4x4 matrix) From world to camera space (4x4 matrix) From camera to screen space (4x4 matrix) can be concatenated! 1,1,1 http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/ -1,-1,-1

1: graphics pipeline 1. Project geometry onto the screen frame Back to cartesian coordinates... and to screen coordinates 1,1,1-1,-1,-1

1: graphics pipeline 1. Project geometry onto the screen frame Questions: How to (intuitively) define a camera matrix? x' y' z' 1 = r u v t a e i 0 b f j 0 c g k 0 d h l 1 x y z 1 1,1,1-1,-1,-1

1: graphics pipeline 1. Project geometry onto the screen frame Questions: Finding a projection matrix Project all points to the image plane z = d 1. Compute x p and y p 2. Find the 4x4 matrix M needed M should be independent from x, y, z!

1: graphics pipeline 1. Project geometry onto the screen frame Thales theorem xp/zp = x/z, with zp=d yp/zp = y/z, with zp=d Find a transform M that divides by z/d

1: graphics pipeline 1. Project geometry onto the screen frame Solution: A transform that divides all coords by z/d set w to z/d New 3D point = Projective transform

1: graphics pipeline 1. Project geometry onto the screen frame 2. Rasterize triangles For each pixel test 3 edge equations if all pass, draw Interpolate vertex data using barycentric coords positions/normals/colors/...

1: graphics pipeline 1. Project geometry onto the screen frame 2. Rasterize triangles For each pixel test 3 edge equations if all pass, draw Interpolate vertex data using barycentric coords positions/normals/colors/...

1: graphics pipeline 1. Project geometry onto the screen frame 2. Rasterize triangles 3. Visibility test For each pixel Store min distance to camera in a Z-Buffer if new_z<z-buffer[x,y] Z-Buffer[x,y] = new_z Framebuffer[x,y] = computepixelcolor()

1: graphics pipeline 1. Project geometry onto the screen frame 2. Rasterize triangles 3. Visibility test 4. Compute pixel color Require more than a simple uniform color This is where we will use material and lighting properties to be continued in next lectures

OpenGL pipeline

Bonus 2. Transforming normal vectors? Affine transformation (translate, rotate, scale..) Exercise: How should we transform normal vectors? Advice : think of the difference between affine transformation of points linear transformations of vectors

Bonus 2. Transforming normal vectors? Affine transformation (translate, rotate, scale..) Apply the same transform to vectors except translations! x' a b c d x Vectorial y' e f g h y = transform z' i j k l z 0 0 0 0 1 0 Same 4x4 matrix Set w=0 for vectors

Bonus 2. Transforming normal vectors? PB: the normal to a triangle does not remain a normal after scaling! B T B N N T A A M N It works for tangent vectors: T= B-A T =MT = MB-MA=B -A How should we transform normals? Defined by: N.T= 0 We are looking for G such that GN.MT = 0 N T G T. M T = 0. so if G T.M= Id, it works! We choose: G = (M -1 ) T (for orthogonal matrices, G=M)