GL transformations-models. x' = x+t x y' = y+t y z' = z+t z 1 0 0 t x 0 1 0 t y s x =s y =s z 0 0 1 t z uniform 0 0 0 1nonuniform?!!?? x' = x·s x y' =

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

1Computer Graphics Homogeneous Coordinates & Transformations Lecture 11/12 John Shearer Culture Lab – space 2
Computer Graphics 2D & 3D Transformation.
02/17/05CISC640/440 OpenGL Tutorial1 OpenGL Tutorial CISC 640/440 Computer Graphics TA: Qi Li/Mani Thomas
Graphics Pipeline.
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.
GRAFIKA KOMPUTER ~ M. Ali Fauzi.
Three Dimensional Viewing
Viewing and Transformation
Viewing & Perspective CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2006.
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
Course Overview, Introduction to CG Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, September 5, 2003.
Viewing and Projections
UniS CS297 Graphics with Java and OpenGL Viewing, the model view matrix.
CS 480/680 Computer Graphics Representation Dr. Frederick C Harris, Jr. Fall 2012.
Transformations Dr. Amy Zhang.
The Viewing Pipeline (Chapter 4) 5/26/ Overview OpenGL viewing pipeline: OpenGL viewing pipeline: – Modelview matrix – Projection matrix Parallel.
Week 2 - Wednesday CS361.
Image Synthesis Rabie A. Ramadan, PhD 2. 2 Java OpenGL Using JOGL: Using JOGL: Wiki: You can download JOGL from.
Geometric transformations The Pipeline
OpenGL Conclusions OpenGL Programming and Reference Guides, other sources CSCI 6360/4360.
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.
Geometric Objects and Transformation
Computer Graphics Bing-Yu Chen National Taiwan University.
OpenGL: Introduction Yanci Zhang Game Programming Practice.
OpenGL The Viewing Pipeline: Definition: a series of operations that are applied to the OpenGL matrices, in order to create a 2D representation from 3D.
Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group computer graphics & visualization 3D Rendering Praktikum: Shader Gallery The.
CSE Real Time Rendering Week 5. Slides(Some) Courtesy – E. Angel and D. Shreiner.
OpenGL Viewing and Modeling Transformation Geb Thomas Adapted from the OpenGL Programming Guidethe OpenGL Programming Guide.
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.
Viewing and Transformation. Pixel pipeline Vertex pipeline Course Map Transformation & Lighting Primitive assembly Viewport culling & clipping Texture.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Jinxiang Chai CSCE 441 Computer Graphics 3-D Viewing 0.
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.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
Geometric Objects and Transformations. Graphics Pipeline How can we render a triangle? High-level description: – Represent the 3D geometry – Transform.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
Chap 3 Viewing and Transformation
Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group computer graphics & visualization GameFX C# / DirectX 2005 The Rendering Pipeline.
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Some Notes on 3-D Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, October 24, 2003.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
CS5500 Computer Graphics March 20, Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts.
Coordinate Systems Lecture 20 Wed, Oct 15, Object Coordinates Each object has its own “local” coordinate system, called object coordinates. Normally.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
GLSL Review Monday, Nov OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
Computer Graphics Lecture 41 Viewing Using OpenGL Taqdees A. Siddiqi
Outline 3D Viewing Required readings: HB 10-1 to 10-10
Computer Graphics Lecture 42 Viewing Using OpenGL II Taqdees A. Siddiqi
Introduction to 3-D Viewing Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, October 27, 2003.
Objectives Introduce standard transformations Introduce standard transformations Derive homogeneous coordinate transformation matrices Derive homogeneous.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics
CSCE 441 Computer Graphics 3-D Viewing
Unit 4 3D Viewing Pipeline Part - 2
CSC461: Lecture 19 Computer Viewing
Three Dimensional Viewing
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University View & Projection.
Projection in 3-D Glenn G. Chappell
Geometric Objects and Transformations (II)
Computer Graphics 3Practical Lesson
Presentation transcript:

GL transformations-models

x' = x+t x y' = y+t y z' = z+t z t x t y s x =s y =s z t z uniform nonuniform?!!?? x' = x·s x y' = y·s y -s x z' = z·s z

x = R·cos(b) y = R·sin(b) z = z x' = R·cos(a+b) x' =R·cos(b)·cos(a)-R·sin(b)·sin(a) = x·cos(a) - y·sin(a) y' = R·sin(a+b) y' = R·cos(b)·sin(a)+R·sin(b)·cos(a)= x·sin(a) + y·cos(a) cos (a) -sin (a)0 0 sin (a) cos (a)

Around z axis cos (a) -sin (a) 0 0 sin (a) cos (a) Around x axis cos (a) -sin (a)0 0 sin (a) cos (a) Around y axis cos (a) 0 -sin (a) sin (a) 0 cos (a)

Shear x' = x+y·b+z· c y' = e·x+y+g· z z' = i·x+j·y+z 1 b c 0 e 1 g 0 i j

Object Transformations in OpenGL Multiplies the current matrix by a matrix that moves/rotates an object glTranslate (x, y, z): glRotate (angle, x, y, z):counterclockwise direction in degrees. glScale (x, y, z): by the corresponding argument x, y, or z. glTranslatef(0.0, 0.0, -5.0). 5 units of distance between the viewpoint and the objects by moving the viewpoint gluLookAt

OpenGL is a graphics API, the computational model behind this API, called the Graphics Pipeline Model, used for producing images of geometric models. The API provides geometric primitives and programming constructs for defining the models. The model is then rendered via a sequence of pipeline stages: Subject these models to several 3D transformations, Followed by clipping, then Projection to the plane. Followed by planar (2D) transformations, and Finally rasterization: converting to pixels. World (or Scene) Coordinates Window Coordinates View (or Eye or Camera) Coordinates Projection Coordinates

OpenGL primitive number type. similar types in C/C++. GLint, GLfloat and GLdouble: Vertices: the atoms for geometric modeling. Vertex is the most basic geometric object. This is a point, in 2 or 3d, the types of the coordinates might be int or float. Specifying in a program.. Vertex(int x, int y);// 2-dimensional Vertex(float x, float y, float z);// 3-dimensional Specifying in gl, (OpenGl syntax) glVertex2i(GLint x, GLint y); glVertex3f(GLfloat x, GLfloat y, GLfloat z);

Object Transformations in OpenGL The transformation process to produce the desired scene for viewing is analogous to taking picture with a camera. The steps with a camera (or a computer): A.Modeling transformation: Arranging the scene to be photographed into the desired composition. B.Viewing transformation: Setting up your tripod and pointing the camera at the scene. C.Projection transformation: Choosing a camera lens or adjusting the zoom. D.Viewport transformation:Determining how large you want the final photograph to be for example, you might want it enlarged. Not necessarily the order in your code should follow this order, but the viewing transformations must precede the modeling transformations in your code, but you can specify the projection and viewport transformations at any point before drawing occurs.

The order in which these operations occur on your computer ???. Construct a 4×4 matrix M to specify viewing, modeling, and projection transformations, which is then multiplied by the coordinates of each vertex v. v'=Mv Note that viewing and modeling transformations are automatically applied to surface normal vectors to form modelview matrix, which is applied to the incoming object coordinates to yield eye coordinates,, (Normal vectors are used only in eye coordinates.) This ensures that the normal vector's relationship to the vertex data is properly preserved. Next, if you've specified arbitrary clipping planes to remove certain objects from the scene or to provide cutaway views of objects, these clipping planes are applied.