CSCI 4620/8626. The 2D Viewing Pipeline

Size: px
Start display at page:

Download "CSCI 4620/8626. The 2D Viewing Pipeline"

Transcription

1 CSCI 4620/8626 Computer Graphics Two-Dimensional Viewing (Chapter 8) Last update: The 2D Viewing Pipeline Given a 2D scene, we select the part of it that we wish to see (render, display) using a clipping window. The only parts of the scene we see are those inside the clipping window. In effect, those parts outside this window are clipped off like using a pair of scissors to trim a photograph. Other terms for the clipping window include world window or viewing window. 2 1

2 The Viewport The viewport is essentially another window, but it is a window into the real estate of the device used to display an image. So the clipping window selects the part of the scene we want to see, and the viewport selects the part of the display where we want it to appear. Be certain you don t confuse these windows with the windows created by a typical GUI associated with an operating system. 3 Figure 8-1 A clipping window and associated viewport, specified as rectangles aligned with the coordinate axes. 2

3 Clipping Window, Viewport Shape In most applications the clipping window(s) and the viewport(s) are rectangles with their edges parallel to the coordinate axes. It is possible, however, to create these windows with other shapes or orientations. As you might expect, processing these will take more time. 5 The 2D Viewing Transformation Pipeline Mapping a 2D world-coordinate scene description to device coordinates is called a 2D viewing transformation (sometimes called window-toviewport transformation, or windowing transformation). We can identify four transformations: Model coordinates (MC) to world coordinates (WC) World coordinates to viewing coordinates (VC) Viewing coordinates to normalized coordinates (NC) Normalized coordinates to device coordinates (DC) 6 3

4 Figure 8-2 Two-dimensional viewing-transformation pipeline. Coordinate Systems Model coordinates are just that they correspond to an object we re modeling. World coordinates identify the location of objects in the entire world that is, the whole scene. Viewing coordinates (often the same as world coordinates) are used to specify clipping windows. Normalized coordinates make everything independent of specific output devices (e.g. -1 to +1 on the X and Y axes). Finally, device coordinates apply to specific devices. 8 4

5 The Clipping Window The clipping window could be any shape, size, and orientation we choose. But anything other than a rectangular region with boundaries parallel to the coordinate axes will require significant computation. Most graphics libraries commonly allow only rectangular clipping windows aligned with the x and y axes. 9 Rotating the Clipping Window There are two obvious ways that can be used to rotate a rectangular clipping window: Define a rectangular clipping window in a rotated viewing-coordinate frame Rotate the world-coordinate scene Usually the clipping window must be specified in world coordinates. 10 5

6 Viewing-Coordinate Clipping Window Choose the origin for a 2D viewing coordinate frame at some world position P 0 = (x 0,y 0 ). Establish the orientation of the clipping window using a world vector V that defines the y view direction. (This is called the 2D view up vector.) Alternately a rotation angle (from the x or y axis) can be specified. 11 Viewing Frame to World Frame Now we can transform (superimpose) the viewing frame on the world frame: Translate the viewing origin to the world origin. Rotate the viewing system to align it with the world frame. Object positions in world coordinates are transformed to viewing coordinates with this matrix: T is the translation matrix. R is the rotation matrix. 12 6

7 Figure 8-3 A rotated clipping window defined in viewing coordinates. World-Coordinate Clipping Window Facility for defining a standard rectangular clipping window in world coordinates is typically provided in a graphics library. This is usually done by specifying the world-coordinate positions of two opposite corners of a standard rectangle that define the clipping window. If we want to rotate in world coordinates, we proceed as we did with viewing coordinates, but do everything in world coordinates; there is no change to the coordinate system. 14 7

8 Figure 8-5 A triangle (a), with a selected reference point and orientation vector, is translated and rotated to position (b) within a clipping window. Normalization and Viewport Transformations Some graphics libraries combine normalization and window-to-viewport transformations. In these cases, the viewport coordinates are often in the [0,1] range. In other systems, the normalization and clipping routines are applied before the viewport translation. In these cases, viewport boundaries are specified in screen coordinates relative to the display window position. 16 8

9 Figure 8-6 A point (xw, yw) in a world-coordinate clipping window is mapped to viewport coordinates (xv, yv), within a unit square, so that the relative positions of the two points in their respective rectangles are the same. A Few Functions (Some Revisited) In OpenGL we can t set up a separate twodimensional viewing coordinate system. Instead, clipping parameters must be set as part of the projection transformation. It is common to do the following to establish a [new] clipping window (parameters are normalized values): glmatrixmode(gl_projection); glloadidentity(); gluortho2d(xwmin,xwmax,ywmin,ywmax); 18 9

10 glmatrixmode(mode) This function specifies which of the various matrices used by opengl will be modified by subsequent matrix operations: mode = GL_MODELVIEW causes the modelview matrix stack to be affected mode = GL_PERSPECTIVE causes the perspective matrix stack to be affected mode = GL_TEXTURE causes the texture matrix stack to be affected 19 gluortho2d(left, right, top, bottom) This function sets up a two-dimensional orthographic viewing region (i.e. a perspective matrix that produces a parallel projection). left, right, top, and bottom specify the coordinates of the various clipping planes (effectively lines in 2D). This is equivalent to calling glortho(left,right,top,bottom,-1,1). The -1 and 1 specify the relative position of the near and far depth planes relative to the viewer. For 2D viewing, these values are appropriate

11 glviewport To specify the viewport (that is, the region of the display window) to be used for drawing) do this: glviewport(x,y,width,height); The parameters are integers given in screen [display window] coordinates (i.e. pixels). The lower-left corner of the viewport is placed at (x,y). The defaults (if glviewport isn t called) are the same as those for the entire window (e.g. 0, 0, window width, window height). 21 Getting Info about Current Viewport To get the dimensions of the current viewport (for example): int vparray[4]; glgetintegerv(xvmgl_viewport, vparray); The four elements of vparray will be set to the (x,y) coordinates of the lower-left corner followed by the width and height of the viewport, all in screen coordinates

12 Creating a GLUT Display Window Setting up a window (review): glutinitwindowposition(xtopleft, ytopleft); glutinitwindowsize(dwwidth,dwheight); glutcreatewindow("window Title ); xtopleft, ytopleft are integer screen coordinates for the upper left corner of the new window. If negative, the windowing system makes the choice. dwwidth and dwheight are integer screen coordinate values for the window size. 23 Setting the Display-Window Mode To set the initial display mode (or modes): glutinitdisplaymode(mode[s]); The mode[s] parameter is the bitwise or of bit patterns specifying buffer combinations and color modes. For example, a common pattern looks like this: glutinitdisplaymode(glut_single GLUT_RGB); Note the textbook error. This is a bitwise or, NOT a logical or

13 Setting the Display-Window Background Color To set the initial display mode background color: glclearcolor(red, green, blue, alpha); The parameters are real values in the range 0-1 if RGB mode is used. If a color table is used, the background color is specified by giving its index: glutclearindex(index); 25 Windows and Window Identifiers Each window has a unique identifier, which is a small positive integer. This value is returned by the glutcreatewindow function. Display-window operations are applied to the current window, which can be set like this: glutsetwindow(windowid); To destroy a window: glutdestroywindow(windowid); To get the current window s ID: windowid = glutgetwindow(); 26 13

14 Window Size, Shape, and Position To reset the location for the current window, give the coordinates of its new upper left corner: glutpositionwindow(newx,newy); To change the size of a window: glutreshapewindow(newwidth,newheight); To switch the current window to full-screen mode: glutfullscreen(); To leave full-screen mode, call the glutpositionwindow or glutreshapewindow function. 27 Multiple Windows A window that is not actively displayed is often represented as an icon (small picture of the window) near the bottom of the screen (or some other common location). To shrink a window: gluticonifywindow(); To change the text associated with this icon (which, by default, is that associated with the window): glutseticontitle("icon Name"); 28 14

15 Push/Pop Show/Hide Windows A window can be partially or totally hidden by other windows. To bring the current window to the front, or to push it behind other windows, you can do these things: glutpopwindow(); /* bring to front */ glutpushwindow(); /* push to rear */ Windows may also be completely taken off the screen, and later restored (also from an iconified state) using these functions: gluthidewindow(); glutshowwindow(); 29 GLUT Subwindows (1) As the name suggests, a subwindow is part of another window. These provide a means of partitioning a larger window into several smaller windows. We can assign an individual display mode to a subwindow, and we can reshape, reposition, push, pop, show and hide subwindows. Subwindows may not be iconified

16 GLUT Subwindows (2) To create a subwindow: newid = glutcreatesubwindow( hostid, xbotleft, ybotleft, width, height); hostid is the ID of the parent window in which the subwindow will be created. (xbotleft,ybotleft) are the screen coordinates of the lower-left corner of the subwindow. Width and height are, as expected, the width and height of the subwindow. 31 GLUT Cursor Control The cursor (a.k.a. mouse pointer ) can take a variety of shapes, with availability dependent on the host system. To change the cursor shape do this: glutsetcursor(shape); Here, shape is one of a set of constant values (defined in glut.h). Some typical examples include GLUT_CURSOR_CROSSHAIR, GLUT_CURSOR_TEXT, GLUT_CURSOR_LEFT_ARROW, and GLUT_CUROR_INFO. See section 4.13 of the GLUT specifications for details

17 More GLUT Callbacks To display something in the current window, assign a callback function that does the work: glutdisplayfunc(fdisplay); To explicitly request redisplay of the current window (or subwindow): glutpostredisplay(); After initialization and all windows have been created and initialized, yield control to the GLUT processing look which will check for new events and displatch them to callback functions: glutmainloop(); 33 Demonstration Programs - XXX Several programs are provided (on Loki) to illustrate many of the functions that have been covered here. 2dzoom draws a square with an X in its center. Use right mouse to select a zoom region, left mouse to reset, and type q or Q to quit. 2dview demonstrates changes to the viewport. le invoke with line width parameter (integer) to show effect of joining wide lines 34 17

Computer Graphics: Two Dimensional Viewing

Computer Graphics: Two Dimensional Viewing Computer Graphics: Two Dimensional Viewing Clipping and Normalized Window By: A. H. Abdul Hafez Abdul.hafez@hku.edu.tr, 1 Outlines 1. End 2 Transformation between 2 coordinate systems To transform positioned

More information

Three-Dimensional Viewing Hearn & Baker Chapter 7

Three-Dimensional Viewing Hearn & Baker Chapter 7 Three-Dimensional Viewing Hearn & Baker Chapter 7 Overview 3D viewing involves some tasks that are not present in 2D viewing: Projection, Visibility checks, Lighting effects, etc. Overview First, set up

More information

CMSC 425: Lecture 4 More about OpenGL and GLUT Tuesday, Feb 5, 2013

CMSC 425: Lecture 4 More about OpenGL and GLUT Tuesday, Feb 5, 2013 CMSC 425: Lecture 4 More about OpenGL and GLUT Tuesday, Feb 5, 2013 Reading: See any standard reference on OpenGL or GLUT. Basic Drawing: In the previous lecture, we showed how to create a window in GLUT,

More information

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science CSC 307 1.0 Graphics Programming Department of Statistics and Computer Science Graphics Programming GLUT 2 Events in OpenGL Event Example Keypress KeyDown KeyUp Mouse leftbuttondown leftbuttonup With mouse

More information

Notes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment

Notes 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 information

Lecture 4. Viewing, Projection and Viewport Transformations

Lecture 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 information

Computer Graphics. Chapter 10 Three-Dimensional Viewing

Computer 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 information

CS 4204 Computer Graphics

CS 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 information

Graphics Programming

Graphics 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 information

3D Graphics Pipeline II Clipping. Instructor Stephen J. Guy

3D 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 information

Getting Started. Overview (1): Getting Started (1): Getting Started (2): Getting Started (3): COSC 4431/5331 Computer Graphics.

Getting 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 information

CSE 167: Lecture #4: Vertex Transformation. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

CSE 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 information

API for creating a display window and using keyboard/mouse interations. See RayWindow.cpp to see how these are used for Assignment3

API for creating a display window and using keyboard/mouse interations. See RayWindow.cpp to see how these are used for Assignment3 OpenGL Introduction Introduction OpenGL OpenGL is an API for computer graphics. Hardware-independent Windowing or getting input is not included in the API Low-level Only knows about triangles (kind of,

More information

Today s class. Viewing transformation Menus Mandelbrot set and pixel drawing. Informationsteknologi

Today 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 information

C OMPUTER G RAPHICS Thursday

C 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 information

UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4620/8626 Computer Graphics Spring 2014 Homework Set 1 Suggested Answers

UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4620/8626 Computer Graphics Spring 2014 Homework Set 1 Suggested Answers UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4620/8626 Computer Graphics Spring 2014 Homework Set 1 Suggested Answers 1. How long would it take to load an 800 by 600 frame buffer with 16 bits per pixel

More information

Drawing Primitives. OpenGL basics

Drawing Primitives. OpenGL basics CSC 706 Computer Graphics / Dr. N. Gueorguieva 1 OpenGL Libraries Drawing Primitives OpenGL basics OpenGL core library OpenGL32 on Windows GL on most unix/linux systems (libgl.a) OpenGL Utility Library

More information

Transformation Pipeline

Transformation 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 information

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline

Today. 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 information

1 (Practice 1) Introduction to OpenGL

1 (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 information

OpenGL Transformations

OpenGL 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 information

// double buffering and RGB glutinitdisplaymode(glut_double GLUT_RGBA); // your own initializations

// double buffering and RGB glutinitdisplaymode(glut_double GLUT_RGBA); // your own initializations #include int main(int argc, char** argv) { glutinit(&argc, argv); Typical OpenGL/GLUT Main Program // GLUT, GLU, and OpenGL defs // program arguments // initialize glut and gl // double buffering

More information

Advanced Computer Graphics (CS & SE )

Advanced Computer Graphics (CS & SE ) Advanced Computer Graphics (CS & SE 233.420) Topics Covered Picking Pipeline Viewing and Transformations Rendering Modes OpenGL can render in one of three modes selected by glrendermode(mode) GL_RENDER

More information

CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation

CSE 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 information

Lectures OpenGL Introduction

Lectures OpenGL Introduction Lectures OpenGL Introduction By Tom Duff Pixar Animation Studios Emeryville, California and George Ledin Jr Sonoma State University Rohnert Park, California 2004, Tom Duff and George Ledin Jr 1 What is

More information

To Do. Computer Graphics (Fall 2008) Course Outline. Course Outline. Methodology for Lecture. Demo: Surreal (HW 3)

To 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 information

Programming using OpenGL: A first Introduction

Programming using OpenGL: A first Introduction Programming using OpenGL: A first Introduction CMPT 361 Introduction to Computer Graphics Torsten Möller Machiraju/Zhang/Möller 1 Today Overview GL, GLU, GLUT, and GLUI First example OpenGL functions and

More information

3D computer graphics: geometric modeling of objects in the computer and rendering them

3D 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 information

Computer Graphics. Chapter 7 2D Geometric Transformations

Computer 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 information

For each question, indicate whether the statement is true or false by circling T or F, respectively.

For each question, indicate whether the statement is true or false by circling T or F, respectively. True/False For each question, indicate whether the statement is true or false by circling T or F, respectively. 1. (T/F) Rasterization occurs before vertex transformation in the graphics pipeline. 2. (T/F)

More information

GRAFIKA KOMPUTER. ~ M. Ali Fauzi

GRAFIKA KOMPUTER. ~ M. Ali Fauzi GRAFIKA KOMPUTER ~ M. Ali Fauzi Drawing 2D Graphics VIEWPORT TRANSFORMATION Recall :Coordinate System glutreshapefunc(reshape); void reshape(int w, int h) { glviewport(0,0,(glsizei) w, (GLsizei) h); glmatrixmode(gl_projection);

More information

Programming with OpenGL Part 2: Complete Programs Computer Graphics I, Fall

Programming with OpenGL Part 2: Complete Programs Computer Graphics I, Fall Programming with OpenGL Part 2: Complete Programs 91.427 Computer Graphics I, Fall 2008 1 1 Objectives Refine first program Alter default values Introduce standard program structure Simple viewing 2-D

More information

GL_COLOR_BUFFER_BIT, GL_PROJECTION, GL_MODELVIEW

GL_COLOR_BUFFER_BIT, GL_PROJECTION, GL_MODELVIEW OpenGL Syntax Functions have prefix gl and initial capital letters for each word glclearcolor(), glenable(), glpushmatrix() glu for GLU functions glulookat(), gluperspective() constants begin with GL_,

More information

Lecture 11: Callbacks. CITS 3003 Graphics & Animation

Lecture 11: Callbacks. CITS 3003 Graphics & Animation Lecture 11: Callbacks CITS 3003 Graphics & Animation Slides: E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 Objectives Learn to build interactive programs using GLUT callbacks

More information

CS 130 Final. Fall 2015

CS 130 Final. Fall 2015 CS 130 Final Fall 2015 Name Student ID Signature You may not ask any questions during the test. If you believe that there is something wrong with a question, write down what you think the question is trying

More information

Lecture 2 CISC440/640 Spring Department of Computer and Information Science

Lecture 2 CISC440/640 Spring Department of Computer and Information Science Lecture 2 CISC440/640 Spring 2015 Department of Computer and Information Science Today s Topic The secrets of Glut-tony 2 So let s do some graphics! For the next week or so this is your world: -1 1-1 1

More information

Lecture 4 of 41. Lab 1a: OpenGL Basics

Lecture 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 information

The Viewing Pipeline adaptation of Paul Bunn & Kerryn Hugo s notes

The 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 information

Working with Callbacks

Working with Callbacks Working with Callbacks 1 Objectives Learn to build interactive programs using GLUT callbacks Mouse Keyboard Reshape Introduce menus in GLUT 2 The mouse callback glutmousefunc(mymouse) void mymouse(glint

More information

Precept 2 Aleksey Boyko February 18, 2011

Precept 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 information

Graphics pipeline and transformations. Composition of transformations

Graphics 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 information

Teacher Assistant : Tamir Grossinger Reception hours: by - Building 37 / office -102 Assignments: 4 programing using

Teacher Assistant : Tamir Grossinger   Reception hours: by  - Building 37 / office -102 Assignments: 4 programing using Teacher Assistant : Tamir Grossinger email: tamirgr@gmail.com Reception hours: by email - Building 37 / office -102 Assignments: 4 programing using C++ 1 theoretical You can find everything you need in

More information

Project Sketchpad. Ivan Sutherland (MIT 1963) established the basic interactive paradigm that characterizes interactive computer graphics:

Project Sketchpad. Ivan Sutherland (MIT 1963) established the basic interactive paradigm that characterizes interactive computer graphics: Project Sketchpad Ivan Sutherland (MIT 1963) established the basic interactive paradigm that characterizes interactive computer graphics: User sees an object on the display User points to (picks) the object

More information

CS 4204 Computer Graphics

CS 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 information

Drawing and Coordinate Systems

Drawing and Coordinate Systems Drawing and Coordinate Systems Coordinate Systems Screen Coordinate system World Coordinate system World window Viewport Window to viewport mapping Screen Coordinate System Glut OpenGL (0,0) Screen Coordinate

More information

OpenGL refresher. Advanced Computer Graphics 2012

OpenGL refresher. Advanced Computer Graphics 2012 Advanced Computer Graphics 2012 What you will see today Outline General OpenGL introduction Setting up: GLUT and GLEW Elementary rendering Transformations in OpenGL Texture mapping Programmable shading

More information

Using OpenGL with CUDA

Using OpenGL with CUDA Using OpenGL with CUDA Installing OpenGL and GLUT; compiling with nvcc Basics of OpenGL and GLUT in C Interoperability between OpenGL and CUDA OpenGL = Open Graphic Library creation of 3D graphic primitives

More information

Introduction to OpenGL Transformations, Viewing and Lighting. Ali Bigdelou

Introduction to OpenGL Transformations, Viewing and Lighting. Ali Bigdelou Introduction to OpenGL Transformations, Viewing and Lighting Ali Bigdelou Modeling From Points to Polygonal Objects Vertices (points) are positioned in the virtual 3D scene Connect points to form polygons

More information

521493S Computer Graphics Exercise 1 (Chapters 1-3)

521493S Computer Graphics Exercise 1 (Chapters 1-3) 521493S Computer Graphics Exercise 1 (Chapters 1-3) 1. Consider the clipping of a line segment defined by the latter s two endpoints (x 1, y 1 ) and (x 2, y 2 ) in two dimensions against a rectangular

More information

Lecture 5: Viewing. CSE Computer Graphics (Fall 2010)

Lecture 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 information

Introduction to Computer Graphics 4. Viewing in 3D

Introduction to Computer Graphics 4. Viewing in 3D Introduction to Computer Graphics 4. Viewing in 3D National Chiao Tung Univ, Taiwan By: I-Chen Lin, Assistant Professor Textbook: E.Angel, Interactive Computer Graphics, 5 th Ed., Addison Wesley Ref: Hearn

More information

OpenGL: 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. 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 information

Computer graphic -- Programming with OpenGL I

Computer graphic -- Programming with OpenGL I Computer graphic -- Programming with OpenGL I A simple example using OpenGL Download the example code "basic shapes", and compile and run it Take a look at it, and hit ESC when you're done. It shows the

More information

SOURCES AND URLS BIBLIOGRAPHY AND REFERENCES

SOURCES AND URLS BIBLIOGRAPHY AND REFERENCES In this article, we have focussed on introducing the basic features of the OpenGL API. At this point, armed with a handful of OpenGL functions, you should be able to write some serious applications. In

More information

Introduction to Computer Graphics with OpenGL/GLUT

Introduction to Computer Graphics with OpenGL/GLUT Introduction to Computer Graphics with OpenGL/GLUT What is OpenGL? A software interface to graphics hardware Graphics rendering API (Low Level) High-quality color images composed of geometric and image

More information

Fachhochschule Regensburg, Germany, February 15, 2017

Fachhochschule 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 information

Controlling the Drawing Display

Controlling the Drawing Display Controlling the Drawing Display In This Chapter 8 AutoCAD provides many ways to display views of your drawing. As you edit your drawing, you can control the drawing display and move quickly to different

More information

Projection Lecture Series

Projection Lecture Series Projection 25.353 Lecture Series Prof. Gary Wang Department of Mechanical and Manufacturing Engineering The University of Manitoba Overview Coordinate Systems Local Coordinate System (LCS) World Coordinate

More information

CSC 470 Computer Graphics

CSC 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 information

Surface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches:

Surface 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 information

CS 112 The Rendering Pipeline. Slide 1

CS 112 The Rendering Pipeline. Slide 1 CS 112 The Rendering Pipeline Slide 1 Rendering Pipeline n Input 3D Object/Scene Representation n Output An image of the input object/scene n Stages (for POLYGON pipeline) n Model view Transformation n

More information

Overview. By end of the week:

Overview. 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 information

Computer Graphics. OpenGL

Computer Graphics. OpenGL Computer Graphics OpenGL What is OpenGL? OpenGL (Open Graphics Library) is a library for computer graphics It consists of several procedures and functions that allow a programmer to specify the objects

More information

3D Viewing. CS 4620 Lecture 8

3D Viewing. CS 4620 Lecture 8 3D Viewing CS 46 Lecture 8 13 Steve Marschner 1 Viewing, backward and forward So far have used the backward approach to viewing start from pixel ask what part of scene projects to pixel explicitly construct

More information

Lesson 1 Parametric Modeling Fundamentals

Lesson 1 Parametric Modeling Fundamentals 1-1 Lesson 1 Parametric Modeling Fundamentals Create Simple Parametric Models. Understand the Basic Parametric Modeling Process. Create and Profile Rough Sketches. Understand the "Shape before size" approach.

More information

CSC 305 The Graphics Pipeline-1

CSC 305 The Graphics Pipeline-1 C. O. P. d y! "#"" (-1, -1) (1, 1) x z CSC 305 The Graphics Pipeline-1 by Brian Wyvill The University of Victoria Graphics Group Perspective Viewing Transformation l l l Tools for creating and manipulating

More information

CSE 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 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 information

12. 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. - 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 information

Modeling Transform. Chapter 4 Geometric Transformations. Overview. Instancing. Specify transformation for objects 李同益

Modeling 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 information

Rasterization Overview

Rasterization Overview Rendering Overview The process of generating an image given a virtual camera objects light sources Various techniques rasterization (topic of this course) raytracing (topic of the course Advanced Computer

More information

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CSE528 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 information

Computer Graphics. Making Pictures. Computer Graphics CSC470 1

Computer Graphics. Making Pictures. Computer Graphics CSC470 1 Computer Graphics Making Pictures Computer Graphics CSC470 1 Getting Started Making Pictures Graphics display: Entire screen (a); windows system (b); [both have usual screen coordinates, with y-axis y

More information

Blue colour text questions Black colour text sample answers Red colour text further explanation or references for the sample answers

Blue colour text questions Black colour text sample answers Red colour text further explanation or references for the sample answers Blue colour text questions Black colour text sample answers Red colour text further explanation or references for the sample answers Question 1. a) (5 marks) Explain the OpenGL synthetic camera model,

More information

Evening s Goals. Mathematical Transformations. Discuss the mathematical transformations that are utilized for computer graphics

Evening 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 information

RECITATION - 1. Ceng477 Fall

RECITATION - 1. Ceng477 Fall RECITATION - 1 Ceng477 Fall 2007-2008 2/ 53 Agenda General rules for the course General info on the libraries GLUT OpenGL GLUI Details about GLUT Functions Probably we will not cover this part 3/ 53 General

More information

Computer Graphics (Basic OpenGL)

Computer 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 information

The Graphics Pipeline and OpenGL I: Transformations!

The Graphics Pipeline and OpenGL I: Transformations! ! The Graphics Pipeline and OpenGL I: Transformations! Gordon Wetzstein! Stanford University! EE 267 Virtual Reality! Lecture 2! stanford.edu/class/ee267/!! Albrecht Dürer, Underweysung der Messung mit

More information

Describe the Orthographic and Perspective projections. How do we combine together transform matrices?

Describe 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 information

Drawing and Coordinate Systems

Drawing and Coordinate Systems Drawing and Coordinate Systems Coordinate Systems World Coordinate system World window Screen Coordinate system Viewport Window to viewport mapping Screen Coordinate System Glut OpenGL (0,0) 0) Screen

More information

CS 591B Lecture 9: The OpenGL Rendering Pipeline

CS 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 information

Computer Graphics Course 2005

Computer Graphics Course 2005 Computer Graphics Course 2005 Introduction to GLUT, GLU and OpenGL Administrative Stuff Teaching Assistant: Rony Goldenthal Reception Hour: Wed. 18:00 19:00 Room 31 (Ross 1) Questions: E-mail: cg@cs Newsgroups:

More information

INTRODUCTION TO COMPUTER GRAPHICS. cs123. It looks like a matrix Sort of. Viewing III. Projection in Practice 1 / 52

INTRODUCTION TO COMPUTER GRAPHICS. cs123. It looks like a matrix Sort of. Viewing III. Projection in Practice 1 / 52 It looks like a matrix Sort of Viewing III Projection in Practice 1 / 52 Arbitrary 3D views } view volumes/frusta spec d by placement and shape } Placement: } Position (a point) } look and up vectors }

More information

Comp 410/510 Computer Graphics Spring Input & Interaction

Comp 410/510 Computer Graphics Spring Input & Interaction Comp 410/510 Computer Graphics Spring 2018 Input & Interaction Objectives Introduce the basic input devices - Physical Devices - Logical Devices Event-driven input Input Modes Programming event input with

More information

OpenGL/GLUT Intro. Week 1, Fri Jan 12

OpenGL/GLUT Intro. Week 1, Fri Jan 12 University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner OpenGL/GLUT Intro Week 1, Fri Jan 12 http://www.ugrad.cs.ubc.ca/~cs314/vjan2007 News Labs start next week Reminder:

More information

Lecture 3 Sections 2.2, 4.4. Mon, Aug 31, 2009

Lecture 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 information

More on Coordinate Systems. Coordinate Systems (3) Coordinate Systems (2) Coordinate Systems (5) Coordinate Systems (4) 9/15/2011

More 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 information

Viewing with Computers (OpenGL)

Viewing 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 information

Tutorial 4: Texture Mapping Techniques

Tutorial 4: Texture Mapping Techniques Tutorial 4: Texture Mapping Techniques Completion time 40 minutes In the previous tutorial we learned how to create materials, and how to assign texture maps to those materials. In this tutorial we will

More information

Insight: Measurement Tool. User Guide

Insight: Measurement Tool. User Guide OMERO Beta v2.2: Measurement Tool User Guide - 1 - October 2007 Insight: Measurement Tool User Guide Open Microscopy Environment: http://www.openmicroscopy.org OMERO Beta v2.2: Measurement Tool User Guide

More information

Modeling with Transformations

Modeling with Transformations Modeling with Transformations Prerequisites This module requires some understanding of 3D geometry, particularly a sense of how objects can be moved around in 3-space. The student should also have some

More information

CSE328 Fundamentals of Computer Graphics

CSE328 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 information

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into 2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into the viewport of the current application window. A pixel

More information

Hierarchical Modeling: Tree of Transformations, Display Lists and Functions, Matrix and Attribute Stacks,

Hierarchical Modeling: Tree of Transformations, Display Lists and Functions, Matrix and Attribute Stacks, Hierarchical Modeling: Tree of Transformations, Display Lists and Functions, Matrix and Attribute Stacks, Hierarchical Modeling Hofstra University 1 Modeling complex objects/motion Decompose object hierarchically

More information

INTRODUCTION TO COMPUTER GRAPHICS. It looks like a matrix Sort of. Viewing III. Projection in Practice. Bin Sheng 10/11/ / 52

INTRODUCTION TO COMPUTER GRAPHICS. It looks like a matrix Sort of. Viewing III. Projection in Practice. Bin Sheng 10/11/ / 52 cs337 It looks like a matrix Sort of Viewing III Projection in Practice / 52 cs337 Arbitrary 3D views Now that we have familiarity with terms we can say that these view volumes/frusta can be specified

More information

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Drawing in 3D (viewing, projection, and the rest of the pipeline) Drawing in 3D (viewing, projection, and the rest of the pipeline) CS559 Spring 2017 Lecture 6 February 2, 2017 The first 4 Key Ideas 1. Work in convenient coordinate systems. Use transformations to get

More information

A Guide to Autodesk Maya 2015

A Guide to Autodesk Maya 2015 A Guide to Autodesk Maya 2015 Written by Mitchell Youngerman Table of Contents Layout of Toolbars...pg 1 Creating Objects...pg 2 Selecting & Deselecting Objects...pg 3 Changing Perspective... pg 4 Transforming

More information

3D Viewing Episode 2

3D 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 information

UNIT 2 2D TRANSFORMATIONS

UNIT 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 information

Announcements OpenGL. Computer Graphics. Spring CS4815

Announcements OpenGL. Computer Graphics. Spring CS4815 Computer Graphics Spring 2017-2018 Outline 1 2 Tutes and Labs Tute02, vector review (see matrix) Week02 lab Lab Marking 10 labs in total each lab worth 3% of overall grade marked on attendance and completion

More information

COMP 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

COMP 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 information