CHAPTER 4 Geometric Transformations: The Pipeline Vivian by Richard S. Wright Jr.

Slides:



Advertisements
Similar presentations
3D Game Programming Geometric Transformations
Advertisements

2 COEN Computer Graphics I Evening’s Goals n Discuss the fundamentals of lighting in computer graphics n Analyze OpenGL’s lighting model n Show.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Projection Matrices modified by Ray Wisman Ed Angel Professor of Computer.
Chapter 3. Drawing primitives in Space Presented by Garrett Yeh.
Chapter 12 Interactive Graphics Chih-Kuo Yeh. Direct Manipulation Demo.
Viewing and Transformation
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
6/15/2015©Zachary Wartell 1 OpenGL Transforms with Object-Oriented Framework Revision 1.1 Copyright Zachary Wartell, University of North Carolina at Charlotte,
Objectives Learn to build arbitrary transformation matrices from simple transformations Learn to build arbitrary transformation matrices from simple transformations.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 OpenGL Transformations Ed Angel Professor of Computer Science, Electrical and Computer.
Viewing & Perspective CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2006.
OpenGL (II). How to Draw a 3-D object on Screen?
CS 4731: Computer Graphics Lecture 11: 3D Viewing Emmanuel Agu.
Introduction to OpenGL Pipeline From Programmer View Tong-Yee Lee.
2D Transformations. World Coordinates Translate Rotate Scale Viewport Transforms Hierarchical Model Transforms Putting it all together.
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
Viewing & Perspective CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2005.
COMP 175: Computer Graphics March 10, 2015
UniS CS297 Graphics with Java and OpenGL Viewing, the model view matrix.
1 OpenGL Basics A Graphics Standard ©Mel Slater, Anthony Steed
OpenGL Matrices and Transformations Angel, Chapter 3 slides from AW, Red Book, etc. CSCI 6360.
The Viewing Pipeline (Chapter 4) 5/26/ Overview OpenGL viewing pipeline: OpenGL viewing pipeline: – Modelview matrix – Projection matrix Parallel.
Geometric transformations The Pipeline
Introduction to OpenGL 1. 2 OpenGL A Graphics rendering API introduced in 1992 by Silicon Graphics Inc Provide the low-level functions to access graphics.
University of Palestine Computer Graphics ITGD3107 Prepare: Mohammed J. el-masre Nidal M. El-Borbar Supervision:
Stages of Vertex Transformation To specify viewing, modeling, and projection transformations, you construct a 4 × 4 matrix M, which is then multiplied.
Computer Graphics Bing-Yu Chen National Taiwan University.
Computer Graphics I, Fall 2010 Computer Viewing.
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
Modeling with OpenGL Practice with OpenGL transformations.
OpenGL: Introduction Yanci Zhang Game Programming Practice.
Graphics Graphics Korea University kucg.korea.ac.kr Viewing 고려대학교 컴퓨터 그래픽스 연구실.
Advanced Viewing Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, October 31, 2003.
Computer Graphics I, Fall 2010 OpenGL Transformations.
2 COEN Computer Graphics I Evening’s Goals n Discuss viewing and modeling transformations n Describe matrix stacks and their uses n Show basic geometric.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 OpenGL Transformations.
Viewing and Transformation. Pixel pipeline Vertex pipeline Course Map Transformation & Lighting Primitive assembly Viewport culling & clipping Texture.
The Camera Analogy ► Set up your tripod and point the camera at the scene (viewing transformation) ► Arrange the scene to be photographed into the desired.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
CGGM Lab. Tan-Chi Ho 2001 Viewing and Transformation.
Transformations Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
OpenGL: The Open Graphics Language Introduction By Ricardo Veguilla.
1 Graphics CSCI 343, Fall 2015 Lecture 18 Viewing III--More Projection.
Viewing and Projection
Chap 3 Viewing and Transformation
1 OpenGL Transformations. 2 Objectives Learn how to carry out transformations in OpenGL ­Rotation ­Translation ­Scaling Introduce OpenGL matrix modes.
1 Geometric Transformations-II Modelling Transforms By Dr.Ureerat Suksawatchon.
Geometric Transformations. Transformations Linear transformations Rigid transformations Affine transformations Projective transformations T Global reference.
Implement of transformation,projection, viewing Hanyang University Jungsik Park.
CSC Graphics Programming Budditha Hettige Department of Statistics and Computer Science.
OpenGL LAB III.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
OpenGL: The Open Graphics Language Technology and Historical Overview By Ricardo Veguilla.
OpenGL Matrices and Transformations Angel, Chapter 3 slides from AW, Red Book, etc. CSCI 6360/4360.
Viewing 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
School of Computer Science
Advanced Graphics Algorithms Ying Zhu Georgia State University
School of Computer Science
Camera Position (5.6) we specify the position and orientation of the camera to determine what will be seen. use gluLookAt (eye x, y, z, at x, y, z, up.
Transformations V, Viewing I Week 3, Fri Jan 22
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics
3D Computer Graphics (3080/GV10) Week 5-6 Tutorial 3
2D Viewing Pipeline.
Computer Graphics (Spring 2003)
Projection in 3-D Glenn G. Chappell
The Modelview Matrix Lecture 8 Mon, Sep 10, 2007.
Transformations in OpenGL
Transformation Back-face culling View frustum culling
Presentation transcript:

CHAPTER 4 Geometric Transformations: The Pipeline Vivian by Richard S. Wright Jr.

Transformation Terminology Viewing Modeling Modelview Projection Viewport

+x +y +z Eye Coordinates -x -y -x -y

Viewing Transformations +x +y +z -x -y (0,0,0)

Translation Rotation Scaling Modeling Transformations

+y +x +y +x +y +x +y +x +y +x +y +x rotation/translation and translation/rotation. θ θ

+x +y +z +x +y +z The Modelview Duality

Projection Transformations OrthographicPerspective

The Matrix: Mathematical Currency for 3D Graphics What is matrix?

The Transformation Pipeline 11 vertexvertex Modelview Matrix Projection Matrix Perspective Division Viewport Transform Modelview Projection object eye clip normalized device window other calculations here –material  color –shade model (flat) –polygon rendering mode –polygon culling –clipping

glTranslatef(x, y, z); glRotatef(angle, x, y, z); glScalef(x, y, z); glLoadIdentity(); The Modelview Matrix

Transformation functions - Translate glTranslatef(x, y, z); Ex: glTranslatef(0.0f, 10.0f, 0.0f);

Transformation functions - Rotate glRotatef(angle, x, y, z); Ex: glRotatef(45.0f, 1.0f, 1.0f, 1.0f);

Transformation functions - Scale glScalef(x, y, z); Ex: glScalef(2.0f, 1.0f, 2.0f);

Transformation functions - The Identity Matrix glLoadIdentity();

Matrix Stack glPushMatrixglPopMatrix glGet(GL_MAX_MODELVIEW_STACK_DEPTH) The Matrix Stacks

A Nuclear Example // First Electron Orbit // Save viewing transformation glPushMatrix(); // Rotate by angle of revolution glRotatef(fElect1, 0.0f, 1.0f, 0.0f); // Translate out from origin to orbit distance glTranslatef(90.0f, 0.0f, 0.0f); // Draw the electron glutSolidSphere(6.0f, 15, 15); // Restore the viewing transformation glPopMatrix();

A Nuclear Example(cont.) // Second Electron Orbit glPushMatrix(); glRotatef(45.0f, 0.0f, 0.0f, 1.0f); glRotatef(fElect1, 0.0f, 1.0f, 0.0f); glTranslatef(-70.0f, 0.0f, 0.0f); glutSolidSphere(6.0f, 15, 15); glPopMatrix(); // Third Electron Orbit glPushMatrix(); glRotatef(360.0f, -45.0f, 0.0f, 0.0f, 1.0f); glRotatef(fElect1, 0.0f, 1.0f, 0.0f); glTranslatef(0.0f, 0.0f, 60.0f); glutSolidSphere(6.0f, 15, 15); glPopMatrix();

Using Projections Orthographic Projections Perspective Projections

Frustum nearfar Perspective viewing volume w h

// Reset coordinate system glMatrixMode(GL_PROJECTION); glLoadIdentity(); // Produce the perspective projection gluPerspective(60.0f, fAspect, 1.0, 400.0);

Advanced Matrix Manipulation GLfloat matrix[16]; // Nice OpenGL friendly matrix Translation/location

Loading a Matrix glLoadMatrixf(GLfloat m); void glLoadTransposeMatrixf(Glfloat* m); // Load an identity matrix GLfloat m[] = { 1.0f, 0.0f, 0.0f, 0.0f, // X Column 0.0f, 1.0f, 0.0f, 0.0f, // Y Column 0.0f, 0.0f, 1.0f, 0.0f, // Z Column 0.0f, 0.0f, 0.0f, 1.0f }; // Translation glMatrixMode(GL_MODELVIEW); glLoadMatrixf(m);