University of British Columbia © MIchiel van de Panne Geometric Transformations and quick OpenGL intro.

Slides:



Advertisements
Similar presentations
Geometric Transformations
Advertisements

Lecture 4: 3D Rendering Pipeline (I) Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Transformations I Week.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Transformations Week 2,
Transformations II Week 2, Wed Jan 17
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Transformations II Week.
Transformations IV Week 3, Wed Jan 23
2D/3D Geometric Transformations CS485/685 Computer Vision Dr. George Bebis.
1 Lecture 4 Graphical primitives Rasterization: algorithmic approach Rasterization: geometric approach 2D discrete lines, triangles Discrete planes 3D.
Transformations Objectives Understand how transformations work in 2D and 3D Understand the concept of homogenous coordinate system Understand scene graphs.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner OpenGL, GLUT, Transformations.
1 Geometrical Transformation Tong-Yee Lee. 2 Modeling Transform Specify transformation for objects Allow definitions of objects in own coordinate systems.
IAT 3551 Computer Graphics Overview Color Displays Drawing Pipeline.
7-2 Similarity and transformations
CHAPTER 7 Viewing and Transformations © 2008 Cengage Learning EMEA.
2D transformations and homogeneous coordinates Dr Nicolas Holzschuch University of Cape Town Modified.
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
1 Computer Graphics Week7 -2D Rotation. 3-Rotation A shape can be rotated about any of the three axes. A rotation about the z-axis will actually rotate.
Basic graphics. ReviewReview Viewing Process, Window and viewport, World, normalized and device coordinates Input and output primitives and their attributes.
Transformation & Projection Feng Yu Proseminar Computer Graphics :
Image Synthesis Rabie A. Ramadan, PhD 2. 2 Java OpenGL Using JOGL: Using JOGL: Wiki: You can download JOGL from.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munzner GLUT, Transformations.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
1. OpenGL/GLU/GLUT  OpenGL v4.0 (latest) is the “core” library that is platform independent  GLUT v3.7 is an auxiliary library that handles window creation,
Object Representation Rama C Hoetzlein, 2010 Univ. of California Santa Barbara Lecture Notes.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
3D transformations Dr Nicolas Holzschuch University of Cape Town Modified by Longin Jan Latecki
Representation. Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames for.
Transformational Geometry CS418 Computer Graphics John C. Hart.
Introduction to OpenGL  OpenGL is a graphics API  Software library  Layer between programmer and graphics hardware (and software)  OpenGL can fit in.
Computer Graphics Bing-Yu Chen National Taiwan University.
Geometric Transformations Hearn & Baker Chapter 5 Some slides are taken from Robert Thomsons notes.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
OpenGL: The Open Graphics Language Introduction By Ricardo Veguilla.
Transformations
David Luebke1/10/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
1 Graphics CSCI 343, Fall 2015 Lecture 9 Geometric Objects.
Honours Graphics 2008 Session 2. Today’s focus Vectors, matrices and associated math Transformations and concatenation 3D space.
CS552: Computer Graphics Lecture 6: Viewing in 2D.
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 15 Creating 3D Models.
III- 1 III 3D Transformation Homogeneous Coordinates The three dimensional point (x, y, z) is represented by the homogeneous coordinate (x, y, z, 1) In.
Computer Graphic Creator: Mohsen Asghari Session 4 Fall 2014.
OpenGL CS418 Computer Graphics John C. Hart. OpenGL Based on GL (graphics library) by Silicon Graphics Inc. (SGI) Advantages: Runs on everything, including.
Rotation Translation Reflection. Review of Cartesian Plane.
Transformations. Transformations Introduce standard transformations ◦ Rotation ◦ Translation ◦ Scaling ◦ Shear Derive homogeneous coordinate transformation.
Transformations. Modeling Transformations  Specify transformations for objects  Allows definitions of objects in own coordinate systems  Allows use.
Instructor: Dr. Shereen Aly Taie Basic Two-Dimensional Geometric Transformation 5.2 Matrix Representations and Homogeneous Coordinates 5.3 Inverse.
Transformations University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner.
Final Review I University of British Columbia
Geometric Transformations Hearn & Baker Chapter 5
Computer Graphics CC416 Week 15 3D Graphics.
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
7-2 Similarity and transformations
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
Transformations 6 University of British Columbia
Transformations 3 University of British Columbia
4-4 Geometric Transformations with Matrices
Models and Architectures
Three-Dimensional Graphics
Models and Architectures
Geometrical Transformations
OpenGL, GLUT, Transformations I Week 2, Wed Jan 16
3D transformations Dr Nicolas Holzschuch University of Cape Town
Transformations 2 University of British Columbia
Transformations Translation Reflection The FRAME Routine
Transformations on the Coordinate Plane
Presentation transcript:

University of British Columbia © MIchiel van de Panne Geometric Transformations and quick OpenGL intro

University of British Columbia Project 0 Get used to OpenGL: compile and run templatecompile and run template change draw routine to dodecahedronchange draw routine to dodecahedron add color change on mouse clickadd color change on mouse click

University of British Columbia OpenGL State State machine: set state variables, including colorset state variables, including color Program structure: graphics initializationgraphics initialization draw routinedraw routine –specify geometric type –provide vertices

University of British Columbia Rendering Triangles Example: glBegin( GL_TRIANGLES ); glColor3f( 1.0, 0.0, 0.0 ); glVertex3f( 0.0, 1.0, 0.0 ); glColor3f( 0.0, 0.0, 1.0 ); glVertex3f( 0.0, 0.0, 0.0 ); glVertex3f(1.0, 0.0, 0.0 ); glEnd(); Every vertex gets the color, etc. that corresponds to the last specified value.

University of British Columbia Points, lines, polygons

University of British Columbia Math Review Working with Frames F2F2F2F2 F3F3F3F3 F1F1F1F1 F1F1F1F1P(3,-1) F2F2F2F2P(-1.5,2) F3F3F3F3P(1,2) y=4? no! y=2 j has horiz and vert components

University of British Columbia Transformations Rotation B A

University of British Columbia 2D Transformations © Marc Levoy

University of British Columbia 2D transformations © Marc Levoy

University of British Columbia Challenge Matrix multiplication for everything except translationfor everything except translation how to do everything with multiplication?how to do everything with multiplication? –then just do composition, no special cases Homogeneous coordinates to the rescue 2D cartesian (x,y) --> 3D homogeneous (x,y,w)2D cartesian (x,y) --> 3D homogeneous (x,y,w) homogeneouscartesian / w

University of British Columbia Homogeneous coordinates © Marc Levoy point in 2D cartesian + weight w = point in 2D cartesian + weight w = point P in 3D homog. coords point P in 3D homog. coords multiples of (x,y,w) multiples of (x,y,w) represent same point in 2D cartesianrepresent same point in 2D cartesian a line L in 3D homoga line L in 3D homog homogenize a point in 3D: homogenize a point in 3D: divide by w to get (x/w, y/w, 1)divide by w to get (x/w, y/w, 1) projects point onto w=1 planeprojects point onto w=1 plane

University of British Columbia Homogeneous coordinates © Marc Levoy w=0 denotes point at infinity w=0 denotes point at infinity think of as direction think of as direction cannot be homogenized cannot be homogenized lies on x-y plane lies on x-y plane (0,0,0) is not allowed (0,0,0) is not allowed

University of British Columbia Transformations Rotation glRotatef(angle,x,y,z);glRotated(angle,x,y,z);

University of British Columbia Transformations Scaling glScalef(a,b,c);glScaled(a,b,c); scale(a,b,c)

University of British Columbia Transformations Translation glTranslatef(a,b,c);glTranslated(a,b,c); translate(a,b,c)