GRAFIKA KOMPUTER. ~ M. Ali Fauzi
|
|
- Peregrine Norris
- 6 years ago
- Views:
Transcription
1 GRAFIKA KOMPUTER ~ M. Ali Fauzi
2 Drawing 2D Graphics
3 VIEWPORT TRANSFORMATION
4 Recall :Coordinate System glutreshapefunc(reshape); void reshape(int w, int h) { glviewport(0,0,(glsizei) w, (GLsizei) h); glmatrixmode(gl_projection); glloadidentity(); gluortho2d(-1.0, 1.0, -1.0, 1.0); }
5 World Coordinate System
6 2 World Coordinate System
7 World Coordinate System ~ The representation of an object is measured in some physical or abstract units. ~ Space in which the object geometry is defined.
8 World Window
9 World Window
10 World Window ~ Rectangle defining the part of the world we wish to display. ~ Area that can be seen (what is captured by the camera), measured in OpenGL coordinates.
11 World Window ~ Known as clipping-area void reshape(int w, int h) { glviewport(0,0,(glsizei) w, (GLsizei) h); glmatrixmode(gl_projection); glloadidentity(); gluortho2d(-1.0, 1.0, -1.0, 1.0); }
12 The Default The default OpenGL 2D clipping-area is an orthographic view with x and y in the range of -1.0 and 1.0, i.e., a 2x2 square with centered at the origin.
13 World Window ~ Reset to the default void reshape(int w, int h) { glviewport(0,0,(glsizei) w, (GLsizei) h); glmatrixmode(gl_projection); glloadidentity(); gluortho2d(-1.0, 1.0, -1.0, 1.0); }
14 Viewport Screen Screen window Interface Window Viewport
15 Screen Coordinate System ~ Space in which the image is displayed ~ For example : 800x600 pixels
16 Interface Window ~ Visual representation of the screen coordinate system for windowed displays glutinitwindowsize(320, 320); glutinitwindowposition(50, 50);
17 Vewport ~ A rectangle on the interface window defining where the image will appear, ~ The default is the entire screen or interface window.
18 Viewport
19 Interface Window ~ Set the viewport to the entire screen / window void reshape(int w, int h) { glviewport(0,0,(glsizei) w, (GLsizei) h); glmatrixmode(gl_projection); glloadidentity(); gluortho2d(-1.0, 1.0, -1.0, 1.0); }
20 Interface Window ~ Set the viewport to half of the screen / window glutinitwindowsize(320, 320); glutinitwindowposition(50, 50); glviewport(0,0,160,160);
21 Viewport Screen Screen window Interface Window Viewport
22 Viewport
23 Viewport Transformation ~ The Process called viewport transformation
24 THE ASPECT RATIO PROBLEM
25 The distortion Screen Screen window Interface Window Viewport
26 The distortion Screen Screen window Interface Window Viewport
27 Ratio ~ R = Aspect Ratio of World
28 Ratio
29 Keeping the Ratio Screen Screen window Interface Window Viewport
30 Keeping the Ratio Screen Screen window Interface Window Viewport
31 The Startegy ~ To avoid distortion, we must change the size of the world window accordingly. ~ For that, we assume that the initial world window is a square with side length L
32 The Startegy ~ Default glortho2d (-L, L, -L, L); ~ For example L=1, glortho2d (-1, 1, -1, 1);
33 The Startegy if (w <= h) glortho2d(-l, L, -L * h/w, L * h/w); else glortho2d(-l * w/h, L * w/h, -L, L); if (w <= h) glortho2d(-1, 1, -1 * h/w, 1 * h/w); else glortho2d(-1 * w/h, 1 * w/h, -1, L);
34 The Startegy
35 The Startegy ~ A possible solution is to change the world window whenever the viewport of the interface window were changed. ~ So, the callback Glvoid reshape(glsizei w, GLsizei h) must include the following code :
36 void reshape(glsizei width, GLsizei height) { if (height == 0) height = 1; GLfloat aspect = (GLfloat)width/(GLfloat)height; glviewport(0, 0, width, height); glmatrixmode(gl_projection); glloadidentity(); if (width >= height) { gluortho2d(-1.0 * aspect, 1.0 * aspect, -1.0, 1.0); } else { gluortho2d(-1.0, 1.0, -1.0 / aspect, 1.0 / aspect); } }
37 /* Handler for window re-size event. Called back when the window first appears and whenever the window is re-sized with its new width and height */ void reshape(glsizei width, GLsizei height) { // GLsizei for non-negative integer // Compute aspect ratio of the new window if (height == 0) height = 1; // To prevent divide by 0 GLfloat aspect = (GLfloat)width / (GLfloat)height; // Set the viewport to cover the new window glviewport(0, 0, width, height); // Set the aspect ratio of the clipping area to match the viewport glmatrixmode(gl_projection); glloadidentity(); // Reset the projection matrix if (width >= height) { // aspect >= 1, set the height from -1 to 1, with larger width gluortho2d(-1.0 * aspect, 1.0 * aspect, -1.0, 1.0); } else { // aspect < 1, set the width to -1 to 1, with larger height gluortho2d(-1.0, 1.0, -1.0 / aspect, 1.0 / aspect); } }
38 2D TRANSFORMATION
39 Transformation Is The geometrical changes of an object from a current state to modified state.
40 Why Needed? To manipulate the initially created object and to display the modified object without having to redraw it
41 Transformation Pipeline Vertex Modelview Matrix Projection Matrix Perspective Division Viewport Transformation Object Coordinates Eye Coordinates Clip Coordinates Normalized device Coordinates Window Coordinates GL_MODELVIEW mode gltranslate() glrotate() glscale() glloadmatrix() glmultmatrix() glulookat() GL_PROJECTION mode glortho() gluortho2d() glfrustum() gluperspective() glviewport()
42 Types of Transformation ~ Modeling. In 3D graphics, handles moving objects around the scene. ~ Viewing. In 3D graphics, specifies the location of the camera.
43 Types of Transformation ~ Projection. Defines the viewing volume and clipping planes from eye coordinate to clip coordinates.
44 Types of Transformation ~ Viewport. Maps the projection of the scene into the rendering window. ~ Modelview. Combination of the viewing and modeling transformations.
45 Transformation Matrix Transformations in OpenGL using matrix concept
46 Matrix Modes ~ ModelView Matrix (GL_MODELVIEW) These concern model-related operations such as translation, rotation, and scaling, as well as viewing transformations.
47 Matrix Modes ~ Projection Matrix (GL_PROJECTION) Setup camera projection and cliiping-area
48 Transformation Pipeline Vertex Modelview Matrix Projection Matrix Perspective Division Viewport Transformation Object Coordinates Eye Coordinates Clip Coordinates Normalized device Coordinates Window Coordinates GL_MODELVIEW mode gltranslate() glrotate() glscale() glloadmatrix() glmultmatrix() glulookat() GL_PROJECTION mode glortho() gluortho2d() glfrustum() gluperspective() glviewport()
49 Why do we use matrix? ~ More convenient organization of data. ~ More efficient processing ~ Enable the combination of various concatenations
50 THE MATRIX
51 Matrix addition and subtraction a b c d = a c b d
52 Matrix addition and subtraction =
53 Matrix addition and subtraction = 6 3
54 Matrix addition and subtraction =
55 Matrix addition and subtraction = -1 4 Tak boleh
56 Matrix Multiplication a c b d. e f g h = a.e + b.g a.f + b.h c.e + d.g c.f + d.h
57 Matrix Multiplication a b. e f g h = a.e + b.g a.f + b.h
58 Matrix Multiplication = 3 1
59 Matrix Multiplication =
60 Matrix Multiplication = 3 1
61 Matrix Multiplication = Tak boleh 3 1
62 Matrix Types e f e f Row Vector Column Vector
63 Matrix Multiplication a c b d. e f = e f. a b c d = e f. a c b d =
64 Matrix Multiplication a c b d. e f = a.e + b.f c.e + d.f e f. a b c d = a.e + c.f b.e + d.f e f. a c b d = a.e + b.f c.e + d.f
65 Matrix Math We ll use the column-vector representation for a point.
66 Matrix Math Which implies that we use premultiplication of the transformation it appears before the point to be transformed in the equation.
67 THE TRANSFORMATION
68 Translation A translation moves all points in an object along the same straight-line path to new positions.
69 Translation The path is represented by a vector, called the translation or shift vector. P' = P + T x y x = y + t x t y New Position Current Position Translation Vector
70 Translation x y x = y + t x t y? x y 2 2 = (2, 2) tx= 6 ty=4
71 Translation x y x = y + t x t y? = (2, 2) tx= 6 ty=4
72 Rotation A rotation repositions all points in an object along a circular path in the plane centered at the pivot point.
73 Rotation P p' x = p x cos p y sin p' y = p x sin + p y cos P
74 Rotation The transformation using Rotation Matrix P' = R. P New Position Rotation Matrix Current Position
75 Rotation The transformation using Rotation Matrix P' = R. P New Position Rotation Matrix Current Position
76 Rotation Find the transformed point, P, caused by rotating P= (5, 1) about the origin through an angle of 90.
77 Rotation
78 Scaling Scaling changes the size of an object and involves two scale factors, Sx and Sy for the x- and y- coordinates respectively.
79 Scaling Scales are about the origin. P p' x = s x p x p' y = s y p y P
80 Scaling The transformation using Scale Matrix P' = S P New Position Scale Matrix Current Position
81 Scaling The transformation using Scale Matrix P' = S P New Position Scale Matrix Current Position
82 Scaling If the scale factors are in between 0 and 1 the points will be moved closer to the origin the object will be smaller.
83 Scaling P(2, 5), Sx = 0.5, Sy = 0.5 Find P? p' x = s x p x p' y = s y p y P(2, 5) P
84 Scaling If the scale factors are larger than 1 the points will be moved away from the origin the object will be larger.
85 Scaling P(2, 5), Sx = 2, Sy = 2 Find P? P p' x = s x p x p' y = s y p y P(2, 5)
86 Scaling If the scale factors are not the same, Sx Sy differential scaling Change in size and shape
87 Scaling If the scale factors are the same, Sx = Sy uniform scaling
88 Scaling P(1, 3), Sx = 2, Sy = 5 square rectangle P p' x = s x p x p' y = s y p y P(1, 2)
89 Scaling What does scaling by 1 do? Sx=1, Sy=1
90 Scaling What does scaling by 1 do? Sx=1, Sy=1 Nothing changed What is that matrix called?
91 Scaling What does scaling by 1 do? Sx=1, Sy=1 Nothing changed What is that matrix called? Identity Matrix
92 Scaling What does scaling by a negative value do? Sx=-2, Sy=-2
93 Scaling What does scaling by a negative value do? Sx=-2, Sy=-2 Moved to Different Quadran
94 COMBINING TRANSFORMATIONS
95 Combining Transf For example, we want to rotate/scale then we want to do translation P' = M P + A
96 Combining Transf For example, we want to translate, then we want to rotate and sclae P' = S R (A + P)
97 Combining Transf P (Px,Py)=(4, 6) : Translate(6, -3) -> Rotation(60 ) -> Scaling (0.5, 2.0) P' = S R (A + P)
98 Combining Transf
99 Combining Transf To combine multiple transformations, we must explicitly compute each transformed point. P' = S R (A + P)
100 Combining Transf It d be nicer if we could use the same matrix operation all the time. But we d have to combine multiplication and addition into a single operation. P' = S R (A + P)
101 Combining Transf Let s move our problem into one dimension higher
102 HOMOGENOUS COORDINATES
103 Homogenous Coord Let point (x, y) in 2D be represented by point (x, y, 1) in the new space. y y w x x
104 Homogenous Coord ~ Scaling our new point by any value a puts us somewhere along a particular line: (ax, ay, a). ~ A point in 2D can be represented in many ways in the new space. ~ (2, 4) > (2, 4, 1) or (8, 16, 4) or (6, 12, 3) or (2, 4, 1) or etc.
105 Homogenous Coord We can always map back to the original 2D point by dividing by the last coordinate (15, 6, 3) (5, 2). (60, 40, 10)?.
106 Homogenous Coord The fact that all the points along each line can be mapped back to the same point in 2D gives this coordinate system its name homogeneous coordinates.
107 Homogenous Coord With homogeneous coordinates, we can combine multiplication and addition into a single operation.
108 Homogenous Coord Point in column-vector: Our point now has three coordinates. So our matrix is needs to be 3x3.
109 Homogenous Coord Translation: x y x = y + t x t y
110 Homogenous Coord Rotation:
111 Homogenous Coord Scaling:
112 Homogenous Coord P (Px,Py)=(4, 6) : Translate(6, -3) -> Rotation(60 ) -> Scaling (0.5, 2.0)
113 Homogenous Coord We can represent any sequence of transformations as a single matrix
114 Homogenous Coord Does the order of operations matter?
115 Homogenous Coord Yes, the order does matter! 1. Translate 2. Rotate 1. Rotate 2. Translate
116 Homogenous Coord Yes, the order does matter! A. B = B. A?
117 Homogenous Coord Yes, the order does matter! A. B B. A
118 Homogenous Coord Yes, the order does matter! (A.B).C = A.(B.C)?
119 Homogenous Coord Yes, the order does matter! (A.B).C = A.(B.C) = = dhl cfl dgj cej dhk cfk dgi cei bhl afl bgj aej bhk afk bgi aei l k j i dh cf dg ce bh af bg ae l k j i h g f e d c b a = = dhl dgj cfl cej dhk dgi cfk cei bhl bgj afl aej bhk bgi afk aei hl gj hk gi fl ej fk ei d c b a l k j i h g f e d c b a
120 Composite Transformation Matrix Arrange the transformation matrices in order from right to left. General Pivot- Point Rotation Operation :- 1. Translate (pivot point is moved to origin) 2. Rotate about origin 3. Translate (pivot point is returned to original position) T(pivot) R() T( pivot)
121 Composite Transformation Matrix T(pivot) R() T( pivot) 1 0 t x 0 1 t y cos -sin 0 sin cos t x 0 1 -t y t x 0 1 t y cos -sin -t x cos+ t y sin sin cos -t x sin - t y cos cos -sin -t x cos+ t y sin + t x sin cos -t x sin - t y cos + t y 0 0 1
122 Other Transf Reflection: x-axis y-axis
123 Other Transf Reflection: origin line x=y
124 Shearing Shearing-x Sebelum Sesudah Shearing-y Sebelum Sesudah
2D Transformations. 7 February 2017 Week 5-2D Transformations 1
2D Transformations 7 Februar 27 Week 5-2D Transformations Matri math Is there a difference between possible representations? a c b e d f ae bf ce df a c b d e f ae cf be df a b c d e f ae bf ce df 7 Februar
More informationComputer Graphics. Chapter 7 2D Geometric Transformations
Computer Graphics Chapter 7 2D Geometric Transformations Chapter 7 Two-Dimensional Geometric Transformations Part III. OpenGL Functions for Two-Dimensional Geometric Transformations OpenGL Geometric Transformation
More information1 Transformations. Chapter 1. Transformations. Department of Computer Science and Engineering 1-1
Transformations 1-1 Transformations are used within the entire viewing pipeline: Projection from world to view coordinate system View modifications: Panning Zooming Rotation 1-2 Transformations can also
More information蔡侑庭 (Yu-Ting Tsai) National Chiao Tung University, Taiwan. Prof. Wen-Chieh Lin s CG Slides OpenGL 2.1 Specification
蔡侑庭 (Yu-Ting Tsai) Department of Computer Science National Chiao Tung University, Taiwan Prof. Wen-Chieh Lin s CG Slides OpenGL 2.1 Specification OpenGL Programming Guide, Chap. 3 & Appendix F 2 OpenGL
More informationGetting Started. Overview (1): Getting Started (1): Getting Started (2): Getting Started (3): COSC 4431/5331 Computer Graphics.
Overview (1): Getting Started Setting up OpenGL/GLUT on Windows/Visual Studio COSC 4431/5331 Computer Graphics Thursday January 22, 2004 Overview Introduction Camera analogy Matrix operations and OpenGL
More informationProf. Feng Liu. Fall /19/2016
Prof. Feng Liu Fall 26 http://www.cs.pdx.edu/~fliu/courses/cs447/ /9/26 Last time More 2D Transformations Homogeneous Coordinates 3D Transformations The Viewing Pipeline 2 Today Perspective projection
More informationViewing COMPSCI 464. Image Credits: Encarta and
Viewing COMPSCI 464 Image Credits: Encarta and http://www.sackville.ednet.ns.ca/art/grade/drawing/perspective4.html Graphics Pipeline Graphics hardware employs a sequence of coordinate systems The location
More informationThe Viewing Pipeline adaptation of Paul Bunn & Kerryn Hugo s notes
The Viewing Pipeline adaptation of Paul Bunn & Kerryn Hugo s notes What is it? The viewing pipeline is the procession of operations that are applied to the OpenGL matrices, in order to create a 2D representation
More informationComputer Graphics. Chapter 10 Three-Dimensional Viewing
Computer Graphics Chapter 10 Three-Dimensional Viewing Chapter 10 Three-Dimensional Viewing Part I. Overview of 3D Viewing Concept 3D Viewing Pipeline vs. OpenGL Pipeline 3D Viewing-Coordinate Parameters
More informationModeling Transform. Chapter 4 Geometric Transformations. Overview. Instancing. Specify transformation for objects 李同益
Modeling Transform Chapter 4 Geometric Transformations 李同益 Specify transformation for objects Allow definitions of objects in own coordinate systems Allow use of object definition multiple times in a scene
More information3D Graphics Pipeline II Clipping. Instructor Stephen J. Guy
3D Graphics Pipeline II Clipping Instructor Stephen J. Guy 3D Rendering Pipeline (for direct illumination) 3D Geometric Primitives 3D Model Primitives Modeling Transformation 3D World Coordinates Lighting
More informationLecture 5: Viewing. CSE Computer Graphics (Fall 2010)
Lecture 5: Viewing CSE 40166 Computer Graphics (Fall 2010) Review: from 3D world to 2D pixels 1. Transformations are represented by matrix multiplication. o Modeling o Viewing o Projection 2. Clipping
More informationOverview of Projections: From a 3D world to a 2D screen.
Overview of Projections: From a 3D world to a 2D screen. Lecturer: Dr Dan Cornford d.cornford@aston.ac.uk http://wiki.aston.ac.uk/dancornford CS2150, Computer Graphics, Aston University, Birmingham, UK
More informationComputer Graphics Geometric Transformations
Computer Graphics 2016 6. Geometric Transformations Hongxin Zhang State Key Lab of CAD&CG, Zhejiang University 2016-10-31 Contents Transformations Homogeneous Co-ordinates Matrix Representations of Transformations
More informationViewing and Projection
CSCI 480 Computer Graphics Lecture 5 Viewing and Projection January 25, 2012 Jernej Barbic University of Southern California Shear Transformation Camera Positioning Simple Parallel Projections Simple Perspective
More informationGeometry: Outline. Projections. Orthographic Perspective
Geometry: Cameras Outline Setting up the camera Projections Orthographic Perspective 1 Controlling the camera Default OpenGL camera: At (0, 0, 0) T in world coordinates looking in Z direction with up vector
More informationLecture 4 of 41. Lab 1a: OpenGL Basics
Lab 1a: OpenGL Basics William H. Hsu Department of Computing and Information Sciences, KSU KSOL course pages: http://snipurl.com/1y5gc Course web site: http://www.kddresearch.org/courses/cis636 Instructor
More informationViewing and Projection
CSCI 480 Computer Graphics Lecture 5 Viewing and Projection Shear Transformation Camera Positioning Simple Parallel Projections Simple Perspective Projections [Geri s Game, Pixar, 1997] January 26, 2011
More informationOpenGL Transformations
OpenGL Transformations R. J. Renka Department of Computer Science & Engineering University of North Texas 02/18/2014 Introduction The most essential aspect of OpenGL is the vertex pipeline described in
More informationE.Order of Operations
Appendix E E.Order of Operations This book describes all the performed between initial specification of vertices and final writing of fragments into the framebuffer. The chapters of this book are arranged
More informationToday. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline
Computergrafik Today Rendering pipeline s View volumes, clipping Viewport Matthias Zwicker Universität Bern Herbst 2008 Rendering pipeline Rendering pipeline Hardware & software that draws 3D scenes on
More information3.1 Viewing and Projection
Fall 2017 CSCI 420: Computer Graphics 3.1 Viewing and Projection Hao Li http://cs420.hao-li.com 1 Recall: Affine Transformations Given a point [xyz] > form homogeneous coordinates [xyz1] > The transformed
More informationProjection: Mapping 3-D to 2-D. Orthographic Projection. The Canonical Camera Configuration. Perspective Projection
Projection: Mapping 3-D to 2-D Our scene models are in 3-D space and images are 2-D so we need some wa of projecting 3-D to 2-D The fundamental approach: planar projection first, we define a plane in 3-D
More informationToday s class. Viewing transformation Menus Mandelbrot set and pixel drawing. Informationsteknologi
Today s class Viewing transformation Menus Mandelbrot set and pixel drawing Monday, November 2, 27 Computer Graphics - Class 7 The world & the window World coordinates describe the coordinate system used
More informationViewing with Computers (OpenGL)
We can now return to three-dimension?', graphics from a computer perspective. Because viewing in computer graphics is based on the synthetic-camera model, we should be able to construct any of the classical
More informationUNIT 2 2D TRANSFORMATIONS
UNIT 2 2D TRANSFORMATIONS Introduction With the procedures for displaying output primitives and their attributes, we can create variety of pictures and graphs. In many applications, there is also a need
More informationComputer Graphics. Bing-Yu Chen National Taiwan University
Computer Graphics Bing-Yu Chen National Taiwan University Introduction to OpenGL General OpenGL Introduction An Example OpenGL Program Drawing with OpenGL Transformations Animation and Depth Buffering
More informationCS 4204 Computer Graphics
CS 4204 Computer Graphics GLUT (Continue) More Interactions Yong Cao Virginia Tech References: Interactive Computer Graphics, Fourth Edition, Ed Angle Orthographical Projection Synthetic camera model View
More information7. 3D Viewing. Projection: why is projection necessary? CS Dept, Univ of Kentucky
7. 3D Viewing Projection: why is projection necessary? 1 7. 3D Viewing Projection: why is projection necessary? Because the display surface is 2D 2 7.1 Projections Perspective projection 3 7.1 Projections
More informationCSE 690: GPGPU. Lecture 2: Understanding the Fabric - Intro to Graphics. Klaus Mueller Stony Brook University Computer Science Department
CSE 690: GPGPU Lecture 2: Understanding the Fabric - Intro to Graphics Klaus Mueller Stony Brook University Computer Science Department Klaus Mueller, Stony Brook 2005 1 Surface Graphics Objects are explicitely
More informationCOMP Computer Graphics and Image Processing. 5: Viewing 1: The camera. In part 1 of our study of Viewing, we ll look at ˆʹ U ˆ ʹ F ˆʹ S
COMP27112 Û ˆF Ŝ Computer Graphics and Image Processing ˆʹ U ˆ ʹ F C E 5: iewing 1: The camera ˆʹ S Toby.Howard@manchester.ac.uk 1 Introduction In part 1 of our study of iewing, we ll look at iewing in
More informationFachhochschule Regensburg, Germany, February 15, 2017
s Operations Fachhochschule Regensburg, Germany, February 15, 2017 s Motivating Example s Operations To take a photograph of a scene: Set up your tripod and point camera at the scene (Viewing ) Position
More informationCSC 470 Computer Graphics
CSC 470 Computer Graphics Transformations of Objects CSC 470 Computer Graphics, Dr.N. Georgieva, CSI/CUNY 1 Transformations of objects - 2D CSC 470 Computer Graphics, Dr.N. Georgieva, CSI/CUNY 2 Using
More informationCSE 167: Lecture #4: Vertex Transformation. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012
CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 Announcements Project 2 due Friday, October 12
More informationGEOMETRIC TRANSFORMATIONS AND VIEWING
GEOMETRIC TRANSFORMATIONS AND VIEWING 2D and 3D 1/44 2D TRANSFORMATIONS HOMOGENIZED Transformation Scaling Rotation Translation Matrix s x s y cosθ sinθ sinθ cosθ 1 dx 1 dy These 3 transformations are
More informationComputer Viewing Computer Graphics I, Fall 2008
Computer Viewing 1 Objectives Introduce mathematics of projection Introduce OpenGL viewing functions Look at alternate viewing APIs 2 Computer Viewing Three aspects of viewing process All implemented in
More informationBooks, OpenGL, GLUT, GLUI, CUDA, OpenCL, OpenCV, PointClouds, and G3D
Books, OpenGL, GLUT, GLUI, CUDA, OpenCL, OpenCV, PointClouds, and G3D CS334 Spring 2012 Daniel G. Aliaga Department of Computer Science Purdue University Computer Graphics Pipeline Geometric Primitives
More informationCS 428: Fall Introduction to. Viewing and projective transformations. Andrew Nealen, Rutgers, /23/2009 1
CS 428: Fall 29 Introduction to Computer Graphics Viewing and projective transformations Andrew Nealen, Rutgers, 29 9/23/29 Modeling and viewing transformations Canonical viewing volume Viewport transformation
More informationNotes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment
Notes on Assignment Notes on Assignment Objects on screen - made of primitives Primitives are points, lines, polygons - watch vertex ordering The main object you need is a box When the MODELVIEW matrix
More informationCS 4204 Computer Graphics
CS 4204 Computer Graphics 3D Viewing and Projection Yong Cao Virginia Tech Objective We will develop methods to camera through scenes. We will develop mathematical tools to handle perspective projection.
More informationC OMPUTER G RAPHICS Thursday
C OMPUTER G RAPHICS 2017.04.27 Thursday Professor s original PPT http://calab.hanyang.ac.kr/ Courses Computer Graphics practice3.pdf TA s current PPT not uploaded yet GRAPHICS PIPELINE What is Graphics
More informationLecture 4. Viewing, Projection and Viewport Transformations
Notes on Assignment Notes on Assignment Hw2 is dependent on hw1 so hw1 and hw2 will be graded together i.e. You have time to finish both by next monday 11:59p Email list issues - please cc: elif@cs.nyu.edu
More informationSurface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches:
Surface Graphics Objects are explicitely defined by a surface or boundary representation (explicit inside vs outside) This boundary representation can be given by: - a mesh of polygons: 200 polys 1,000
More informationAnnouncements. Submitting Programs Upload source and executable(s) (Windows or Mac) to digital dropbox on Blackboard
Now Playing: Vertex Processing: Viewing Coulibaly Amadou & Mariam from Dimanche a Bamako Released August 2, 2005 Rick Skarbez, Instructor COMP 575 September 27, 2007 Announcements Programming Assignment
More informationEvening s Goals. Mathematical Transformations. Discuss the mathematical transformations that are utilized for computer graphics
Evening s Goals Discuss the mathematical transformations that are utilized for computer graphics projection viewing modeling Describe aspect ratio and its importance Provide a motivation for homogenous
More informationPrecept 2 Aleksey Boyko February 18, 2011
Precept 2 Aleksey Boyko February 18, 2011 Getting started Initialization Drawing Transformations Cameras Animation Input Keyboard Mouse Joystick? Textures Lights Programmable pipeline elements (shaders)
More informationMore on Coordinate Systems. Coordinate Systems (3) Coordinate Systems (2) Coordinate Systems (5) Coordinate Systems (4) 9/15/2011
Computer Graphics using OpenGL, Chapter 3 Additional Drawing Tools More on Coordinate Systems We have been using the coordinate system of the screen window (in pixels). The range is from 0 (left) to some
More informationBooks, OpenGL, GLUT, CUDA, OpenCL, OpenCV, PointClouds, G3D, and Qt
Books, OpenGL, GLUT, CUDA, OpenCL, OpenCV, PointClouds, G3D, and Qt CS334 Fall 2015 Daniel G. Aliaga Department of Computer Science Purdue University Books (and by now means complete ) Interactive Computer
More informationOverview. By end of the week:
Overview By end of the week: - Know the basics of git - Make sure we can all compile and run a C++/ OpenGL program - Understand the OpenGL rendering pipeline - Understand how matrices are used for geometric
More informationSpring 2013, CS 112 Programming Assignment 2 Submission Due: April 26, 2013
Spring 2013, CS 112 Programming Assignment 2 Submission Due: April 26, 2013 PROJECT GOAL: Write a restricted OpenGL library. The goal of the project is to compute all the transformation matrices with your
More informationTo Do. Computer Graphics (Fall 2008) Course Outline. Course Outline. Methodology for Lecture. Demo: Surreal (HW 3)
Computer Graphics (Fall 2008) COMS 4160, Lecture 9: OpenGL 1 http://www.cs.columbia.edu/~cs4160 To Do Start thinking (now) about HW 3. Milestones are due soon. Course Course 3D Graphics Pipeline 3D Graphics
More informationGraphics pipeline and transformations. Composition of transformations
Graphics pipeline and transformations Composition of transformations Order matters! ( rotation * translation translation * rotation) Composition of transformations = matrix multiplication: if T is a rotation
More informationTransforms 1 Christian Miller CS Fall 2011
Transforms 1 Christian Miller CS 354 - Fall 2011 Transformations What happens if you multiply a square matrix and a vector together? You get a different vector with the same number of coordinates These
More informationCSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation
CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013 Announcements Project 2 due Friday, October 11
More informationModels and The Viewing Pipeline. Jian Huang CS456
Models and The Viewing Pipeline Jian Huang CS456 Vertex coordinates list, polygon table and (maybe) edge table Auxiliary: Per vertex normal Neighborhood information, arranged with regard to vertices and
More informationTransformation Pipeline
Transformation Pipeline Local (Object) Space Modeling World Space Clip Space Projection Eye Space Viewing Perspective divide NDC space Normalized l d Device Coordinatesd Viewport mapping Screen space Coordinate
More informationCSCI 4620/8626. The 2D Viewing Pipeline
CSCI 4620/8626 Computer Graphics Two-Dimensional Viewing (Chapter 8) Last update: 2016-03-3 The 2D Viewing Pipeline Given a 2D scene, we select the part of it that we wish to see (render, display) using
More informationCS Computer Graphics: Transformations & The Synthetic Camera
CS 543 - Computer Graphics: Transformations The Snthetic Camera b Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-) Introduction to Transformations A transformation changes an objects Size
More informationBasic Graphics Programming
15-462 Computer Graphics I Lecture 2 Basic Graphics Programming Graphics Pipeline OpenGL API Primitives: Lines, Polygons Attributes: Color Example January 17, 2002 [Angel Ch. 2] Frank Pfenning Carnegie
More informationTo Do. Outline. Translation. Homogeneous Coordinates. Foundations of Computer Graphics. Representation of Points (4-Vectors) Start doing HW 1
Foundations of Computer Graphics Homogeneous Coordinates Start doing HW 1 To Do Specifics of HW 1 Last lecture covered basic material on transformations in 2D Likely need this lecture to understand full
More informationComputer Graphics (CS 4731) Lecture 11: Implementing Transformations. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)
Computer Graphics (CS 47) Lecture : Implementing Transformations Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Objectives Learn how to implement transformations in OpenGL
More informationComputer Graphics 7: Viewing in 3-D
Computer Graphics 7: Viewing in 3-D In today s lecture we are going to have a look at: Transformations in 3-D How do transformations in 3-D work? Contents 3-D homogeneous coordinates and matrix based transformations
More informationCS 591B Lecture 9: The OpenGL Rendering Pipeline
CS 591B Lecture 9: The OpenGL Rendering Pipeline 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination Spring 2007 Rui Wang 3D Polygon Rendering Many applications
More informationCS380: Computer Graphics 2D Imaging and Transformation. Sung-Eui Yoon ( 윤성의 ) Course URL:
CS380: Computer Graphics 2D Imaging and Transformation Sung-Eui Yoon ( 윤성의 ) Course URL: http://sglab.kaist.ac.kr/~sungeui/cg Class Objectives Write down simple 2D transformation matrixes Understand the
More informationDescribe the Orthographic and Perspective projections. How do we combine together transform matrices?
Aims and objectives By the end of the lecture you will be able to Work with multiple transform matrices Describe the viewing process in OpenGL Design and build a camera control APIs Describe the Orthographic
More information3D Viewing Episode 2
3D Viewing Episode 2 1 Positioning and Orienting the Camera Recall that our projection calculations, whether orthographic or frustum/perspective, were made with the camera at (0, 0, 0) looking down the
More informationComputer Graphics: Geometric Transformations
Computer Graphics: Geometric Transformations Geometric 2D transformations By: A. H. Abdul Hafez Abdul.hafez@hku.edu.tr, 1 Outlines 1. Basic 2D transformations 2. Matrix Representation of 2D transformations
More informationCS 4204 Computer Graphics
CS 424 Computer Graphics 2D Transformations Yong Cao Virginia Tech References: Introduction to Computer Graphics course notes by Doug Bowman Interactive Computer Graphics, Fourth Edition, Ed Angle Transformations
More informationPart 3: 2D Transformation
Part 3: 2D Transformation 1. What do you understand by geometric transformation? Also define the following operation performed by ita. Translation. b. Rotation. c. Scaling. d. Reflection. 2. Explain two
More informationCS602 Midterm Subjective Solved with Reference By WELL WISHER (Aqua Leo)
CS602 Midterm Subjective Solved with Reference By WELL WISHER (Aqua Leo) www.vucybarien.com Question No: 1 What are the two focusing methods in CRT? Explain briefly. Page no : 26 1. Electrostatic focusing
More informationCOMP3421. Introduction to 3D Graphics
COMP3421 Introduction to 3D Graphics 3D coodinates Moving to 3D is simply a matter of adding an extra dimension to our points and vectors: 3D coordinates 3D coordinate systems can be left or right handed.
More informationViewing Transformation
CS38: Computer Graphics Viewing Transformation Sung-Eui Yoon ( 윤성의 ) Course URL: http://sglab.kaist.ac.kr/~sungeui/cg/ Class Objectives Know camera setup parameters Understand viewing and projection processes
More informationWindows and Viewports. Windows and Viewports. Windows and Viewports. Windows and Viewports. CSC 706 Computer Graphics
CSC 706 Computer Graphics World World Window, Screen Window and Viewport Setting Window and Viewport automatically Tiling Previously we looked at an OpenGL window where x and y were plotted as positive
More informationOverview. Viewing and perspectives. Planar Geometric Projections. Classical Viewing. Classical views Computer viewing Perspective normalization
Overview Viewing and perspectives Classical views Computer viewing Perspective normalization Classical Viewing Viewing requires three basic elements One or more objects A viewer with a projection surface
More informationFundamental Types of Viewing
Viewings Fundamental Types of Viewing Perspective views finite COP (center of projection) Parallel views COP at infinity DOP (direction of projection) perspective view parallel view Classical Viewing Specific
More information1 (Practice 1) Introduction to OpenGL
1 (Practice 1) Introduction to OpenGL This first practical is intended to get you used to OpenGL command. It is mostly a copy/paste work. Try to do it smartly by tweaking and messing around with parameters,
More informationComputer Graphics (Basic OpenGL)
Computer Graphics (Basic OpenGL) Thilo Kielmann Fall 2008 Vrije Universiteit, Amsterdam kielmann@cs.vu.nl http://www.cs.vu.nl/ graphics/ Computer Graphics (Basic OpenGL, Input and Interaction), ((57))
More information12. Selection. - The objects selected are specified by hit records in the selection buffer. E.R. Bachmann & P.L. McDowell MV 4202 Page 1 of 13
12. Selection Picking is a method of capturing mouse clicks at some window position and determining what objects are beneath it. The basic idea is to enter the selection rendering mode with a small viewing
More informationCSE 167: Introduction to Computer Graphics Lecture #5: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017
CSE 167: Introduction to Computer Graphics Lecture #5: Projection Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017 Announcements Friday: homework 1 due at 2pm Upload to TritonEd
More informationCSE528 Computer Graphics: Theory, Algorithms, and Applications
CSE528 Computer Graphics: Theory, Algorithms, and Applications Hong Qin Stony Brook University (SUNY at Stony Brook) Stony Brook, New York 11794-2424 Tel: (631)632-845; Fax: (631)632-8334 qin@cs.stonybrook.edu
More informationCSE328 Fundamentals of Computer Graphics
CSE328 Fundamentals of Computer Graphics Hong Qin State University of New York at Stony Brook (Stony Brook University) Stony Brook, New York 794--44 Tel: (63)632-845; Fax: (63)632-8334 qin@cs.sunysb.edu
More informationVector Algebra Transformations. Lecture 4
Vector Algebra Transformations Lecture 4 Cornell CS4620 Fall 2008 Lecture 4 2008 Steve Marschner 1 Geometry A part of mathematics concerned with questions of size, shape, and relative positions of figures
More informationEECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing
EECE 478 Rasterization & Scenes Rasterization Learning Objectives Be able to describe the complete graphics pipeline. Describe the process of rasterization for triangles and lines. Compositing Manipulate
More informationUnit 3 Transformations and Clipping
Transformation Unit 3 Transformations and Clipping Changes in orientation, size and shape of an object by changing the coordinate description, is known as Geometric Transformation. Translation To reposition
More informationComputer Graphics (CS 4731) Lecture 11: Implementing Transformations. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)
Computer Graphics (CS 47) Lecture : Implementing Transformations Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Objectives Learn how to implement transformations in OpenGL
More informationLecture 3 Sections 2.2, 4.4. Mon, Aug 31, 2009
Model s Lecture 3 Sections 2.2, 4.4 World s Eye s Clip s s s Window s Hampden-Sydney College Mon, Aug 31, 2009 Outline Model s World s Eye s Clip s s s Window s 1 2 3 Model s World s Eye s Clip s s s Window
More informationOpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL
OpenGL: Open Graphics Library Introduction to OpenGL Part II CS 351-50 Graphics API ( Application Programming Interface) Software library Layer between programmer and graphics hardware (and other software
More informationCOMP3421. Introduction to 3D Graphics
COMP3421 Introduction to 3D Graphics 3D coodinates Moving to 3D is simply a matter of adding an extra dimension to our points and vectors: 3D coordinates 3D coordinate systems can be left or right handed.
More informationMouse Ray Picking Explained
Mouse Ray Picking Explained Brian Hook http://www.bookofhook.com April 5, 2005 1 Introduction There comes a time in every 3D game where the user needs to click on something in the scene. Maybe he needs
More informationGraphics Programming
Graphics Programming 3 rd Week, 2011 OpenGL API (1) API (application programming interface) Interface between an application program and a graphics system Application Program OpenGL API Graphics Library
More information2D and 3D Transformations AUI Course Denbigh Starkey
2D and 3D Transformations AUI Course Denbigh Starkey. Introduction 2 2. 2D transformations using Cartesian coordinates 3 2. Translation 3 2.2 Rotation 4 2.3 Scaling 6 3. Introduction to homogeneous coordinates
More informationChapter 5. Projections and Rendering
Chapter 5 Projections and Rendering Topics: Perspective Projections The rendering pipeline In order to view manipulate and view a graphics object we must find ways of storing it a computer-compatible way.
More informationComputer Viewing. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science
Computer Viewing CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science 1 Objectives Introduce the mathematics of projection Introduce OpenGL viewing functions Look at
More information3D computer graphics: geometric modeling of objects in the computer and rendering them
SE313: Computer Graphics and Visual Programming Computer Graphics Notes Gazihan Alankus, Spring 2012 Computer Graphics 3D computer graphics: geometric modeling of objects in the computer and rendering
More informationCOMP3421. Introduction to 3D Graphics
COMP3421 Introduction to 3D Graphics 3D coordinates Moving to 3D is simply a matter of adding an extra dimension to our points and vectors: 3D coordinates 3D coordinate systems can be left or right handed.
More informationCS 543: Computer Graphics. Projection
CS 543: Computer Graphics Projection Robert W. Lindeman Associate Professor Interactive Media & Game Development Department of Computer Science Worcester Poltechnic Institute gogo@wpi.edu with lots of
More informationPerspective transformations
Perspective transformations Transformation pipeline Modelview: model (position objects) + view (position the camera) Projection: map viewing volume to a standard cube Perspective division: project D to
More informationReview of Thursday. xa + yb xc + yd
Review of Thursday Vectors and points are two/three-dimensional objects Operations on vectors (dot product, cross product, ) Matrices are linear transformations of vectors a c b x d y = xa + yb xc + yd
More informationCS559: Computer Graphics. Lecture 12: OpenGL Transformation Li Zhang Spring 2008
CS559: Computer Graphics Lecture 2: OpenGL Transformation Li Zhang Spring 28 Today Transformation in OpenGL Reading Chapter 3 Last time Primitive Details glpolygonmode(glenum face, GLenum mode); face:
More informationBOUNCING BALL IMRAN IHSAN ASSISTANT PROFESSOR
COMPUTER GRAPHICS LECTURE 07 BOUNCING BALL IMRAN IHSAN ASSISTANT PROFESSOR WWW.IMRANIHSAN.COM /* * GL07BouncingBall.cpp: A ball bouncing inside the window */ #include // for MS Windows #include
More information