IMGD The Game Development Process: 3D Modeling and Transformations

Similar documents
CS Computer Graphics: Transformations & The Synthetic Camera

Using GLU/GLUT Objects. GLU/GLUT Objects. glucylinder() glutwirecone() GLU/GLUT provides very simple object primitives

CS 543: Computer Graphics. 3D Transformations

CMSC 425: Lecture 10 Basics of Skeletal Animation and Kinematics

4. Two Dimensional Transformations

Modeling Transformations

Modeling Transformations

What and Why Transformations?

Modeling Transformations

Scene Graphs & Modeling Transformations COS 426

Computer Graphics. Geometric Transformations

Computer Graphics. Geometric Transformations

Transformations II. Week 2, Wed Jan 17

Computer Graphics (CS 543) Lecture 6a: Hierarchical 3D Models. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

CSE328 Fundamentals of Computer Graphics: Theory, Algorithms, and Applications

CS559: Computer Graphics

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

CS F-07 Objects in 2D 1

Modeling Transformations

Image Warping. Some slides from Steve Seitz

Modeling Transformations

Image Warping. Some slides from Steve Seitz

Introduction to Homogeneous Transformations & Robot Kinematics

Determining the 2d transformation that brings one image into alignment (registers it) with another. And

Notes. University of British Columbia

Transformations III. Week 2, Fri Jan 19

Image Warping : Computational Photography Alexei Efros, CMU, Fall Some slides from Steve Seitz

Geometric Transformations

3-Dimensional Viewing

CS770/870 Spring 2017 Transformations

Think About. Unit 5 Lesson 3. Investigation. This Situation. Name: a Where do you think the origin of a coordinate system was placed in creating this

CS 543: Computer Graphics. Projection

3D Geometry and Camera Calibration

Uses of Transformations. 2D transformations Homogeneous coordinates. Transformations. Transformations. Transformations. Transformations and matrices

Homogeneous Coordinates

Image Warping, mesh, and triangulation CSE399b, Spring 07 Computer Vision

Image Warping (Szeliski Sec 2.1.2)

Modeling Transformations Revisited

Image Warping CSE399b, Spring 07 Computer Vision

Today s class. Geometric objects and transformations. Informationsteknologi. Wednesday, November 7, 2007 Computer Graphics - Class 5 1

CS 543: Computer Graphics Lecture 4 (Part I): 3D Affine transforms. Emmanuel Agu

Homework #1. Displays, Image Processing, Affine Transformations, Hierarchical modeling, Projections

6. Modelview Transformations

1. We ll look at: Types of geometrical transformation. Vector and matrix representations

Introduction to Homogeneous Transformations & Robot Kinematics

Must first specify the type of projection desired. When use parallel projections? For technical drawings, etc. Specify the viewing parameters

The 3-D Graphics Rendering Pipeline

Chapter 3 : Computer Animation

Transformations. Examples of transformations: shear. scaling

Computer Graphics. Si Lu. Fall er_graphics.htm 10/11/2017

Perspective Projection Transformation

2D Transformations. 7 February 2017 Week 5-2D Transformations 1

MEM380 Applied Autonomous Robots Winter Robot Kinematics

Transformations II. Arbitrary 3D Rotation. What is its inverse? What is its transpose? Can we constructively elucidate this relationship?

More on Transformations. COS 426, Spring 2019 Princeton University

Using GLU/GLUT Objects

To Do. Course Outline. Course Outline. Goals. Motivation. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 3: Transformations 1

Two Dimensional Viewing

Interactive Computer Graphics. Warping and morphing. Warping and Morphing. Warping and Morphing. Lecture 14+15: Warping and Morphing. What is.

Warping, Morphing and Mosaics

Two possible ways to specify transformations. Each part of the object is transformed independently relative to the origin

Lecture 4: Transforms. Computer Graphics CMU /15-662, Fall 2016

Image warping. image filtering: change range of image. image warping: change domain of image g(x) = f(h(x)) h(y)=0.5y+0.5. h([x,y])=[x,y/2] f h

CSE528 Computer Graphics: Theory, Algorithms, and Applications

What does OpenGL do?

CT5510: Computer Graphics. Transformation BOCHANG MOON

High Dimensional Rendering in OpenGL

CS 2770: Intro to Computer Vision. Multiple Views. Prof. Adriana Kovashka University of Pittsburgh March 14, 2017

CS Computer Graphics: Introduction to Ray Tracing

CS Computer Graphics: Introduction to Ray Tracing

Project 2: 3D transforms and Cameras

CS 335 Graphics and Multimedia. Geometric Warping

[ ] [ ] Orthogonal Transformation of Cartesian Coordinates in 2D & 3D. φ = cos 1 1/ φ = tan 1 [ 2 /1]

3D graphics rendering pipeline (1) 3D graphics rendering pipeline (3) 3D graphics rendering pipeline (2) 8/29/11

Affine and Projective Transformations

Editing and Transformation

Chap 7, 2009 Spring Yeong Gil Shin

Illumination & Shading I

3D Coordinates & Transformations

Image Warping. Many slides from Alyosha Efros + Steve Seitz. Photo by Sean Carroll

Last Lecture. Edge Detection. Filtering Pyramid

Computer Graphics: Viewing in 3-D. Course Website:

Geometric Model of Camera

(x, y) (ρ, θ) ρ θ. Polar Coordinates. Cartesian Coordinates

Linear and Affine Transformations Coordinate Systems

1/29/13. Computer Graphics. Transformations. Simple Transformations

Matrix Transformations. Affine Transformations

IMGD The Game Development Process: Animation

Viewing and Projection

GEOMETRIC TRANSFORMATIONS AND VIEWING

2D/3D Geometric Transformations and Scene Graphs

CS770/870 Spring 2017 Transformations

Homework #1. Displays, Image Processing, Affine Transformations, Hierarchical Modeling

A New Concept on Automatic Parking of an Electric Vehicle

Three-Dimensional Coordinates

Computer Graphics. P04 Transformations. Aleksandra Pizurica Ghent University

IMGD The Game Development Process: File Formats

Image Warping. Computational Photography Derek Hoiem, University of Illinois 09/28/17. Photo by Sean Carroll

How is project #1 going?

Computer Graphics Hands-on

Transcription:

IMGD - The Game Development Process: 3D Modeling and Transformations b Robert W. Lindeman (gogo@wpi.edu Kent Quirk (kent_quirk@cognito.com (with lots of input from Mark Clapool! Overview of 3D Modeling Modeling Create 3D model of scene/objects Coordinate sstems (left hand, right hand Basic shapes (cone, clinder, etc. Transformations/Matrices Lighting/Materials Snthetic camera basics View volume Projection Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 2

Coordinate Sstems Right-handed and left-handed coordinate sstems Make an "L" with inde finger and thumb No real "standard," but... Converting from one to the other is a simple transformation +Y +X +Y +Z +X +Z Right-Handed Coordinate Sstem Left-Handed Coordinate Sstem Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 3 Right-Handed Coordinates To determine positive rotations Make a fist with our right hand, and stick thumb up in the air (CCW +Y +Z +X Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 4 2

Hierarchical Transformations Graphical scenes have object dependencies Man small objects Attributes (position, orientation, etc. depend on each other hammer A Robot Hammer! lower arm base Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 5 Hierarchical Transformations (cont. Object dependenc description using tree structure Base Lower arm Upper arm Hammer Root node Leaf node Object position and orientation can be affected b its parent, grand-parent, grand-grand-parent, nodes Hierarchical representation is known as Scene Graph Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 6 3

Transformations Two was to specif transformations. Absolute transformation: each part of the object is transformed independentl relative to the origin Translate the base b (5,, ; Translate the lower arm b (5, 2, ; Translate the upper arm b (5, 4, ; Translate the hammer head b (5, 4, 4 Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 7 Relative Transformations A better (and easier wa. Relative transformation: Specif the transformation for each object relative to its parent Step : Translate the base (and its descendants b (5,, ; Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 8 4

Relative Transformations (cont. Step 2: Rotate the lower arm and (its descendants relative to the bases local ais b -9 degrees Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 9 Relative Transformations Using a Scene Graph Base Translate (5,, Lower arm Rotate (-9 about its local Upper arm Hammer Appl all the wa down Appl all the wa down Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 5

Introduction to Transformations A transformation changes an objects Sie (scaling Position (translation Orientation (rotation We will introduce first in 2D or (,, build intuition Later, talk about 3D and 4D? Transform object b appling sequence of matri multiplications to object vertices Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science Wh Matrices? All transformations can be performed using matri/vector multiplication Allows pre-multiplication of all matrices Note: point (, needs to be represented as (,,, also called homogeneous coordinates Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 2 6

Point Representation We use a column matri (2 matri to represent a 2D point General form of transformation of a point (, to (, can be written as: a + b + c d + e + f or a b c d e f * Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 3 Translation To reposition a point along a straight line Given point (, and translation distance (t, t The new point: (, (, + t + t (, or P P + T where P P t T t Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 4 7

8 Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 5 33 2D Translation Matri t t + use 3 vector t t * Note: it becomes a matri-vector multiplication + t + t Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 6 Translation of Objects How to translate an object with multiple vertices? Translate individual vertices

9 Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 7 2D Scaling Scale: Alter object sie b scaling factor (s, s. i.e., * S * S (, (2,2 S 2, S 2 (2,2 (4,4 S S Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 8 33 2D Scaling Matri S S S S * S * S

2D Rotation Default rotation center is origin (, > : Rotate counter clockwise < : Rotate clockwise Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 9 2D Rotation (cont. (, -> Rotate about the origin b (, (, r (, How to compute (,? r* r*sin( r* + r*sin( + Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 2

Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 2 2D Rotation (cont. Using trig. identities (, (, r sin( sin( + Matri form? sin( sin( sin sin cos cos + sin cos cos sin sin( + + Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 22 33 2D Rotation Matri (, (, r sin( sin( sin( sin(

2D Rotation How to rotate an object with multiple vertices? Rotate individual Vertices Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 23 Arbitrar Rotation Center To rotate about arbitrar point P (P, P b : Translate object b T(-P, -P so that P coincides with origin Rotate the object b R( Translate object back: T(P, P In matri form T(P,P R( T(-P,-P * P P sin( P sin( Similar for arbitrar scaling anchor P P Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 24 2

Composing Transformations Composing transformations Appling several transforms in succession to form one overall transformation Eample M X M2 X M3 X P where M, M2, M3 are transform matrices applied to P Be careful with the order! For eample Translate b (5,, then rotate 6 degrees is NOT same as Rotate b 6 degrees, then translate b (5, Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 25 3D Transformations Affine transformations Mappings of points to new points that retain certain relationships Lines remain lines Several transformations can be combined into a single matri Two was to think about transformations Object transformations All points of an object are transformed Coordinate transformations The coordinate sstem is transformed, and models remain defined relative to this Lindeman & Quirk (& Clapool - WPI Dept. of Computer Science 26 3