The Projection Matrix

Size: px
Start display at page:

Download "The Projection Matrix"

Transcription

1 The Projection Matrix Lecture 8 Robb T. Koether Hampden-Sydney College Fri, Sep 11, 2015 Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

2 Outline 1 Coordinate Systems 2 The Projection Matrix The Transformation The ortho2d() Function 3 Uniform Shader Variables 4 Resizing the Window 5 Assignment 5 6 Assignment Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

3 Outline 1 Coordinate Systems 2 The Projection Matrix The Transformation The ortho2d() Function 3 Uniform Shader Variables 4 Resizing the Window 5 Assignment 5 6 Assignment Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

4 Homogeneous Coordinates OpenGL performs all of its geometric calculations in 4 dimensions. The 4th coordinate w is called the homogeneous coordinate. We will see later the role that it plays. For now, w should always be 1. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

5 Homogeneous Coordinates When working in 2 dimensions (x, y) or 3 dimensions (x, y, z), OpenGL will use all 4 dimensions (x, y, z, w). In the xy-plane, z = 0 and w = 1. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

6 World Coordinate System The coordinates system that we use to draw objects is the world coordinate system. That system is whatever system we find to be convenient. The world coordinate system is either 2D or 3D, whichever we choose to use. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

7 Normalized Device Coordinate System The coordinate system used in the frame buffer is the normalized device coordinate system. It is a 2-dimensional system, with 1 x 1 and 1 y 1. The projection matrix will convert world coordinates into normalized device coordinates. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

8 Screen Coordinate System In the screen coordinate system, each pixel is one unit. The upper-left corner of the screen is the origin (0, 0). The lower-right corner is determined by the resolution of the screen. If the resolution is , then the lower-right corner is (1680, 1050). Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

9 Outline 1 Coordinate Systems 2 The Projection Matrix The Transformation The ortho2d() Function 3 Uniform Shader Variables 4 Resizing the Window 5 Assignment 5 6 Assignment Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

10 Outline 1 Coordinate Systems 2 The Projection Matrix The Transformation The ortho2d() Function 3 Uniform Shader Variables 4 Resizing the Window 5 Assignment 5 6 Assignment Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

11 The Projection Matrix The transformations described above can be carried out by multiplying by the projection matrix proj = 2 right left 0 0 right+left right left 2 0 top bottom 0 top+bottom top bottom Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

12 The Projection Matrix Matrix multiplication X = PX will perform the transformation. x 2 y right left 0 0 right+left right left x 0 = 2 0 top bottom 0 top+bottom top bottom y Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

13 The Projection Matrix The Projection Matrix Suppose our scene is drawn in a rectangle with left = 4, right = 4, bottom = 3 and top = 3. Then the projection matrix is Map the point (2, 1). proj = Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

14 The Projection Matrix The Projection Matrix Suppose our scene is drawn in a rectangle with left = 0, right = 8, bottom = 0 and top = 4. Then the projection matrix is Map the point (2, 1). proj = Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

15 Outline 1 Coordinate Systems 2 The Projection Matrix The Transformation The ortho2d() Function 3 Uniform Shader Variables 4 Resizing the Window 5 Assignment 5 6 Assignment Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

16 The ortho2d() Function The ortho2d() Function mat4 ortho2d(left, right, bottom, top) The ortho2d() function will create the projection matrix. We must pass it to the vertex shader. The shader must multiply it by the vertex. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

17 Outline 1 Coordinate Systems 2 The Projection Matrix The Transformation The ortho2d() Function 3 Uniform Shader Variables 4 Resizing the Window 5 Assignment 5 6 Assignment Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

18 Uniform Shader Variables A uniform shader variable is a shader variable whose value does not change during the processing of the vertices of a primitive, i.e., a call to gldrawarrays(). Its value is set by the application program and passed to the shader. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

19 Uniform Shader Variables Passing a Shader Variable GLint glgetuniformlocation(program, name); In the application program, we must get a location for the uniform variable. The glgetuniformlocation() will return a location. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

20 Uniform Shader Variables Passing a Shader Variable void gluniform*(location, value); void gluniform*(location, count, values); void gluniformmatrix*(location, count, GL_TRUE, values); The functions gluniform*() and gluniformmatrix*() will pass the value(s) to the shaders. The third parameter of gluniformmatrix*() tells whether to take the transpose of the matrix being passed. See p. 48 of the Red Book. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

21 Passing the Projection Matrix Passing the Projection Matrix mat4 proj = ortho2d(left, right, bottom, top); GLuint proj_loc = glgetuniformlocation(program, "proj"); gluniformmatrix4fv(proj_loc, 1, GL_TRUE, proj); This code with create the projection matrix and pass it to the shaders. "proj" is the name of the uniform variable in the shader. It is a good idea to keep the same name in order to avoid confusion. Later, we will have many uniform variables. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

22 Using the Projection Matrix Using the Projection Matrix uniform mat4 proj; layout (location = 0) in vec2 vposition; void main() { gl_position = proj*vec4(vposition, 0.0f, 1.0f); } In the shader program, we simply declare the variable to be uniform. The name must match the name specified in the application program. Then multiply it by the position vector and assign to gl_position. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

23 Outline 1 Coordinate Systems 2 The Projection Matrix The Transformation The ortho2d() Function 3 Uniform Shader Variables 4 Resizing the Window 5 Assignment 5 6 Assignment Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

24 Resizing the Window When the window is resized by the user, the reshape() function is automatically called. It is the responsibility of the reshape() function to create a new projection matrix, based on the new dimensions of the window. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

25 The reshape() Function The reshape() Function void reshape(int wid, int hgt) { // Compute new window boundaries. // Compute and transfer projection matrix to shaders proj = ortho2d(left, right, bottom, top); gluniformmatrix4fv(proj_loc, 1, GL_TRUE, proj); }. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

26 Resizing the Window The questions is, how to recompute left, right, bottom, and top? Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

27 Resizing the Window The questions is, how to recompute left, right, bottom, and top? We will label the new values LEFT, RIGHT, BOTTOM, and TOP. Choose a point that is to be fixed. Upper-left corner Lower-left corner Center Etc. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

28 Resizing the Window Suppose we keep the lower-left corner fixed. If the window is expanded, then the expansion will reveal more of the scene to the right and above. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

29 Lower-Left Corner Fixed Lower-Left Corner Fixed TOP WIDTH top width HEIGHT height BOTTOM = bottom LEFT = left right RIGHT Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

30 Lower-Left Corner Fixed left, right, bottom, and top are in world coordinates. width and height are in screen coordinates. Be careful! Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

31 Lower-Left Corner Fixed Clearly, LEFT = left and BOTTOM = bottom. Also, we have the relation RIGHT LEFT right left = WIDTH width. Therefore, RIGHT = LEFT + ( ) WIDTH (right left). width Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

32 Lower-Left Corner Fixed Similarly, TOP = BOTTOM + ( HEIGHT height ) (top bottom). Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

33 The reshape() Function The reshape() Function void reshape(int wid, int hgt) { // Compute new window boundaries float right = left + (float)wid/scr_width*(right - left); float top = bottom + (float)hgt/scr_height*(top - bottom); proj = ortho2d(left, right, bottom, top);. } Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

34 Center Fixed Center Fixed TOP top WIDTH width y height HEIGHT bottom BOTTOM LEFT left x right RIGHT We may keep the center fixed. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

35 Resizing the Window We may keep any point fixed. If the window is expanded, then the expansion will reveal area to the left and right, and the bottom and bottom, in proportion to the fixed point s location. For example, if the point is 1 6 of the way from left to right, then 1 6 of the revealed area will be to the left and 5 6 will be to the right. The same holds in the vertical direction. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

36 Resizing the Window Resizing the Window TOP WIDTH top width height HEIGHT y P bottom BOTTOM LEFT left x right RIGHT Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

37 Lower-Left Corner Fixed To keep the point (x, y) fixed, we must have the relation Therefore, x LEFT x left LEFT = x = WIDTH width. ( ) WIDTH (x left). width Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

38 Lower-Left Corner Fixed The full set of equations is ( ) WIDTH LEFT = x (x left), width ( ) WIDTH RIGHT = x + (right x), width ( ) HEIGHT BOTTOM = y (y bottom), height ( ) HEIGHT TOP = y + (top y). height Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

39 The reshape() Function The reshape() Function void reshape(int wid, int hgt) { // Compute new window boundaries float left = x - (float)wid/scr_width*(x - left); float right = x + (float)wid/scr_width*(right - x); float bottom = y - (float)hgt/scr_height*(y - bottom); float top = y + (float)hgt/scr_height*(top - y); proj = ortho2d(left, right, bottom, top);. } Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

40 Lower-Left Corner Fixed For example, if we wanted to keep the upper-right corner fixed, then x = right, y = top and the equations become ( ) WIDTH LEFT = right (right left), width RIGHT = right, BOTTOM = top TOP = top. ( HEIGHT height ) (top bottom), Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

41 Outline 1 Coordinate Systems 2 The Projection Matrix The Transformation The ortho2d() Function 3 Uniform Shader Variables 4 Resizing the Window 5 Assignment 5 6 Assignment Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

42 Assignment 5 Assignment 5 Give the demo program LowerLeftFixed.cpp the new name CenterFixed.cpp. Modify the reshape() function so that the center of the scene remains in the center of the window when the window is resized. Write a program named GameOfLife.cpp that will Draw a square 512 pixels by 512 pixels centered in the window. Draw 33 vertical lines, dividing the square into 32 vertical strips. Draw 33 horizontal lines, dividing the square into little squares. Use colors that contrast pleasingly. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

43 Outline 1 Coordinate Systems 2 The Projection Matrix The Transformation The ortho2d() Function 3 Uniform Shader Variables 4 Resizing the Window 5 Assignment 5 6 Assignment Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

44 Assignment Assignment Read pp , User Transformations. Read pp , Orthographic Projection. Robb T. Koether (Hampden-Sydney College) The Projection Matrix Fri, Sep 11, / 43

The Projection Matrix

The Projection Matrix The Projection Matrix Lecture 5 Robb T. Koether Hampden-Sydney College Wed, Aug 30, 2017 Robb T. Koether (Hampden-Sydney College) The Projection Matrix Wed, Aug 30, 2017 1 / 21 Outline 1 The World Coordinate

More information

The Graphics Pipeline

The Graphics Pipeline The Graphics Pipeline Lecture 2 Robb T. Koether Hampden-Sydney College Fri, Aug 28, 2015 Robb T. Koether (Hampden-Sydney College) The Graphics Pipeline Fri, Aug 28, 2015 1 / 19 Outline 1 Vertices 2 The

More information

The Graphics Pipeline

The Graphics Pipeline The Graphics Pipeline Lecture 2 Robb T. Koether Hampden-Sydney College Wed, Aug 23, 2017 Robb T. Koether (Hampden-Sydney College) The Graphics Pipeline Wed, Aug 23, 2017 1 / 19 Outline 1 Vertices 2 The

More information

Computer Graphics (4731) Lecture 4: 2D Graphics Systems (Drawing Polylines, tiling, & Aspect Ratio)

Computer Graphics (4731) Lecture 4: 2D Graphics Systems (Drawing Polylines, tiling, & Aspect Ratio) Computer Graphics (4731) Lecture 4: 2D Graphics Systems (Drawing Polylines, tiling, & Aspect Ratio) Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Screen Coordinate System

More information

Shader Programs. Lecture 30 Subsections 2.8.2, Robb T. Koether. Hampden-Sydney College. Wed, Nov 16, 2011

Shader Programs. Lecture 30 Subsections 2.8.2, Robb T. Koether. Hampden-Sydney College. Wed, Nov 16, 2011 Shader Programs Lecture 30 Subsections 2.8.2, 2.8.3 Robb T. Koether Hampden-Sydney College Wed, Nov 16, 2011 Robb T. Koether (Hampden-Sydney College) Shader Programs Wed, Nov 16, 2011 1 / 43 Outline 1

More information

Shading Triangles. Lecture 37. Robb T. Koether. Hampden-Sydney College. Mon, Nov 30, 2015

Shading Triangles. Lecture 37. Robb T. Koether. Hampden-Sydney College. Mon, Nov 30, 2015 Shading Triangles Lecture 37 Robb T. Koether Hampden-Sydney College Mon, Nov 30, 2015 Robb T. Koether (Hampden-Sydney College) Shading Triangles Mon, Nov 30, 2015 1 / 35 Outline 1 Shading Triangles Barycentric

More information

Specular Reflection. Lecture 19. Robb T. Koether. Hampden-Sydney College. Wed, Oct 4, 2017

Specular Reflection. Lecture 19. Robb T. Koether. Hampden-Sydney College. Wed, Oct 4, 2017 Specular Reflection Lecture 19 Robb T. Koether Hampden-Sydney College Wed, Oct 4, 2017 Robb T. Koether (Hampden-Sydney College) Specular Reflection Wed, Oct 4, 2017 1 / 22 Outline 1 Specular Reflection

More information

Computer Graphics (CS 543) Lecture 2b: 2D Graphics Systems (Drawing Polylines, tiling, & Aspect Ratio)

Computer Graphics (CS 543) Lecture 2b: 2D Graphics Systems (Drawing Polylines, tiling, & Aspect Ratio) Computer Graphics (CS 543) Lecture 2b: 2D Graphics Systems (Drawing Polylines, tiling, & Aspect Ratio) Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Announcements All code

More information

Computer Graphics (CS 4731) & 2D Graphics Systems

Computer Graphics (CS 4731) & 2D Graphics Systems Computer Graphics (CS 4731) Lecture 4: Shader Setup & 2D Graphics Systems Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Recall: OpenGL Program: Shader Setup initshader(

More information

Density Curves Sections

Density Curves Sections Density Curves Sections 3.1-3.2 Lecture 8 Robb T. Koether Hampden-Sydney College Wed, Jan 27, 2016 Robb T. Koether (Hampden-Sydney College) Density CurvesSections 3.1-3.2 Wed, Jan 27, 2016 1 / 18 Outline

More information

The Model Stack. Lecture 8. Robb T. Koether. Hampden-Sydney College. Wed, Sep 6, 2017

The Model Stack. Lecture 8. Robb T. Koether. Hampden-Sydney College. Wed, Sep 6, 2017 The Model Stack Lecture 8 Robb T. Koether Hampden-Sydney College Wed, Sep 6, 2017 Robb T. Koether (Hampden-Sydney College) The Model Stack Wed, Sep 6, 2017 1 / 19 Outline 1 Drawing Rectangle Man 2 The

More information

Applying Textures. Lecture 27. Robb T. Koether. Hampden-Sydney College. Fri, Nov 3, 2017

Applying Textures. Lecture 27. Robb T. Koether. Hampden-Sydney College. Fri, Nov 3, 2017 Applying Textures Lecture 27 Robb T. Koether Hampden-Sydney College Fri, Nov 3, 2017 Robb T. Koether (Hampden-Sydney College) Applying Textures Fri, Nov 3, 2017 1 / 24 Outline 1 Applying Textures 2 Photographs

More information

The Critical-Path Algorithm

The Critical-Path Algorithm The Critical-Path Algorithm Lecture 32 Sections 8.3-8.4 Robb T. Koether Hampden-Sydney College Wed, Nov 19, 2014 Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Wed, Nov 19, 2014 1

More information

The Traveling Salesman Problem Brute Force Method

The Traveling Salesman Problem Brute Force Method The Traveling Salesman Problem Brute Force Method Lecture 30 Sections 6.1, 6.3 Robb T. Koether Hampden-Sydney College Fri, Nov 3, 2017 Robb T. Koether (Hampden-Sydney College)The Traveling Salesman Problem

More information

Solving Recursive Sequences by Iteration

Solving Recursive Sequences by Iteration Solving Recursive Sequences by Iteration Lecture 25 Section 5.7 Robb T. Koether Hampden-Sydney College Thu, Feb 28, 2013 Robb T. Koether (Hampden-Sydney College) Solving Recursive Sequences by Iteration

More information

Magnification and Minification

Magnification and Minification Magnification and Minification Lecture 30 Robb T. Koether Hampden-Sydney College Fri, Nov 6, 2015 Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 1 / 17 Outline

More information

Minimal Spanning Trees

Minimal Spanning Trees Minimal Spanning Trees Lecture 33 Sections 7.1-7.3 Robb T. Koether Hampden-Sydney College Wed, Apr 11, 20 Robb T. Koether (Hampden-Sydney College) Minimal Spanning Trees Wed, Apr 11, 20 1 / 17 1 Networks

More information

The Mesh Class. Lecture 23. Robb T. Koether. Hampden-Sydney College. Wed, Oct 18, 2017

The Mesh Class. Lecture 23. Robb T. Koether. Hampden-Sydney College. Wed, Oct 18, 2017 The Mesh Class Lecture 23 Robb T. Koether Hampden-Sydney College Wed, Oct 18, 2017 Robb T. Koether (Hampden-Sydney College) The Mesh Class Wed, Oct 18, 2017 1 / 21 Outline 1 The Mesh Class 2 Assignment

More information

Abstract Data Types. Lecture 23 Section 7.1. Robb T. Koether. Hampden-Sydney College. Wed, Oct 24, 2012

Abstract Data Types. Lecture 23 Section 7.1. Robb T. Koether. Hampden-Sydney College. Wed, Oct 24, 2012 Abstract Data Types Lecture 23 Section 7.1 Robb T. Koether Hampden-Sydney College Wed, Oct 24, 2012 Robb T. Koether (Hampden-Sydney College) Abstract Data Types Wed, Oct 24, 2012 1 / 19 1 Abstract Data

More information

The View Frustum. Lecture 9 Sections 2.6, 5.1, 5.2. Robb T. Koether. Hampden-Sydney College. Wed, Sep 14, 2011

The View Frustum. Lecture 9 Sections 2.6, 5.1, 5.2. Robb T. Koether. Hampden-Sydney College. Wed, Sep 14, 2011 The View Frustum Lecture 9 Sections 2.6, 5.1, 5.2 Robb T. Koether Hampden-Sydney College Wed, Sep 14, 2011 Robb T. Koether (Hampden-Sydney College) The View Frustum Wed, Sep 14, 2011 1 / 36 Outline 1 The

More information

The Pairwise-Comparison Method

The Pairwise-Comparison Method The Pairwise-Comparison Method Lecture 10 Section 1.5 Robb T. Koether Hampden-Sydney College Mon, Sep 11, 2017 Robb T. Koether (Hampden-Sydney College) The Pairwise-Comparison Method Mon, Sep 11, 2017

More information

The Class Construct Part 1

The Class Construct Part 1 The Class Construct Part 1 Lecture 23 Sections 7.5-7.6 Robb T. Koether Hampden-Sydney College Fri, Oct 26, 2018 Robb T. Koether (Hampden-Sydney College) The Class Construct Part 1 Fri, Oct 26, 2018 1 /

More information

Scope and Parameter Passing

Scope and Parameter Passing Scope and Parameter Passing Lecture 17 Sections 6.5, 6.10, 6.13 Robb T. Koether Hampden-Sydney College Fri, Oct 5, 2018 Robb T. Koether (Hampden-Sydney College) Scope and Parameter Passing Fri, Oct 5,

More information

Comp 410/510 Computer Graphics Spring Programming with OpenGL Part 4: Three Dimensions

Comp 410/510 Computer Graphics Spring Programming with OpenGL Part 4: Three Dimensions Comp 410/510 Computer Graphics Spring 2018 Programming with OpenGL Part 4: Three Dimensions Objectives Develop a bit more sophisticated three-dimensional example - Rotating cube Introduce hidden-surface

More information

while Loops Lecture 13 Sections Robb T. Koether Wed, Sep 26, 2018 Hampden-Sydney College

while Loops Lecture 13 Sections Robb T. Koether Wed, Sep 26, 2018 Hampden-Sydney College while Loops Lecture 13 Sections 5.8-5.9 Robb T. Koether Hampden-Sydney College Wed, Sep 26, 2018 Robb T. Koether (Hampden-Sydney College) while Loops Wed, Sep 26, 2018 1 / 25 1 while Loops 2 Input Loops

More information

Programming Languages

Programming Languages Programming Languages Lecture 3 Robb T. Koether Hampden-Sydney College Fri, Aug 31, 2018 Robb T. Koether (Hampden-Sydney College) Programming Languages Fri, Aug 31, 2018 1 / 23 1 Programming Languages

More information

Ambient and Diffuse Light

Ambient and Diffuse Light Ambient and Diffuse Light Lecture 20 Robb T. Koether Hampden-Sydney College Mon, Oct 12, 2015 Robb T. Koether (Hampden-Sydney College) Ambient and Diffuse Light Mon, Oct 12, 2015 1 / 29 Outline 1 Lighting

More information

Programming Languages

Programming Languages Programming Languages Lecture 3 Section 1.3 Robb T. Koether Hampden-Sydney College Mon, Sep 2, 2013 Robb T. Koether (Hampden-Sydney College) Programming Languages Mon, Sep 2, 2013 1 / 25 1 Programming

More information

The Plurality-with-Elimination Method

The Plurality-with-Elimination Method The Plurality-with-Elimination Method Lecture 9 Section 1.4 Robb T. Koether Hampden-Sydney College Fri, Sep 8, 2017 Robb T. Koether (Hampden-Sydney College) The Plurality-with-Elimination Method Fri, Sep

More information

The Traveling Salesman Problem Nearest-Neighbor Algorithm

The Traveling Salesman Problem Nearest-Neighbor Algorithm The Traveling Salesman Problem Nearest-Neighbor Algorithm Lecture 31 Sections 6.4 Robb T. Koether Hampden-Sydney College Fri, Apr 6, 2018 Robb T. Koether (Hampden-Sydney College)The Traveling Salesman

More information

Today s Agenda. Shaders fundamentals. Programming with shader-based OpenGL

Today s Agenda. Shaders fundamentals. Programming with shader-based OpenGL Today s Agenda Shaders fundamentals Programming with shader-based OpenGL Shaders Like a function call data are passed in, processed, and passed back out -- Shreiner et al, OpenGL Programming Guide GLSL

More information

Sampling Distribution Examples Sections 15.4, 15.5

Sampling Distribution Examples Sections 15.4, 15.5 Sampling Distribution Examples Sections 15.4, 15.5 Lecture 27 Robb T. Koether Hampden-Sydney College Wed, Mar 2, 2016 Robb T. Koether (Hampden-Sydney College)Sampling Distribution ExamplesSections 15.4,

More information

CS 432 Interactive Computer Graphics

CS 432 Interactive Computer Graphics CS 432 Interactive Computer Graphics Lecture 2 Part 2 Introduction to Shaders Matt Burlick - Drexel University - CS 432 1 Shaders To understand shaders, let s look at the graphics pipeline again The job

More information

Mipmaps. Lecture 35. Robb T. Koether. Hampden-Sydney College. Wed, Nov 18, 2015

Mipmaps. Lecture 35. Robb T. Koether. Hampden-Sydney College. Wed, Nov 18, 2015 Mipmaps Lecture 35 Robb T. Koether Hampden-Sydney College Wed, Nov 18, 2015 Robb T. Koether (Hampden-Sydney College) Mipmaps Wed, Nov 18, 2015 1 / 31 Outline 1 Discrete Sampling 2 Mipmaps 3 Generating

More information

Recursive Sequences. Lecture 24 Section 5.6. Robb T. Koether. Hampden-Sydney College. Wed, Feb 26, 2014

Recursive Sequences. Lecture 24 Section 5.6. Robb T. Koether. Hampden-Sydney College. Wed, Feb 26, 2014 Recursive Sequences Lecture 24 Section 5.6 Robb T. Koether Hampden-Sydney College Wed, Feb 26, 2014 Robb T. Koether (Hampden-Sydney College) Recursive Sequences Wed, Feb 26, 2014 1 / 26 1 Recursive Sequences

More information

Scope and Parameter Passing

Scope and Parameter Passing Scope and Parameter Passing Lecture 16 Sections 6.5, 6.10, 6.13 Robb T. Koether Hampden-Sydney College Mon, Oct 7, 2013 Robb T. Koether (Hampden-Sydney College) Scope and Parameter Passing Mon, Oct 7,

More information

Boxplots. Lecture 17 Section Robb T. Koether. Hampden-Sydney College. Wed, Feb 10, 2010

Boxplots. Lecture 17 Section Robb T. Koether. Hampden-Sydney College. Wed, Feb 10, 2010 Boxplots Lecture 17 Section 5.3.3 Robb T. Koether Hampden-Sydney College Wed, Feb 10, 2010 Robb T. Koether (Hampden-Sydney College) Boxplots Wed, Feb 10, 2010 1 / 34 Outline 1 Boxplots TI-83 Boxplots 2

More information

LR Parsing - Conflicts

LR Parsing - Conflicts LR Parsing - Conflicts Lecture 15 Sections 4.5, 4.6 Robb T. Koether Hampden-Sydney College Fri, Feb 20, 2015 Robb T. Koether (Hampden-Sydney College) LR Parsing - Conflicts Fri, Feb 20, 2015 1 / 15 1 Shift/Reduce

More information

Scheduling and Digraphs

Scheduling and Digraphs Scheduling and Digraphs Lecture 35 Sections 8.1, 8.2 Robb T. Koether Hampden-Sydney College Mon, Nov 21, 2016 Robb T. Koether (Hampden-Sydney College) Scheduling and Digraphs Mon, Nov 21, 2016 1 / 25 1

More information

Shaders. Slide credit to Prof. Zwicker

Shaders. Slide credit to Prof. Zwicker Shaders Slide credit to Prof. Zwicker 2 Today Shader programming 3 Complete model Blinn model with several light sources i diffuse specular ambient How is this implemented on the graphics processor (GPU)?

More information

Pointers. Lecture 2 Sections Robb T. Koether. Hampden-Sydney College. Fri, Jan 18, 2013

Pointers. Lecture 2 Sections Robb T. Koether. Hampden-Sydney College. Fri, Jan 18, 2013 Pointers Lecture 2 Sections 10.3-10.8 Robb T. Koether Hampden-Sydney College Fri, Jan 18, 2013 Robb T. Koether (Hampden-Sydney College) Pointers Fri, Jan 18, 2013 1 / 35 1 Introduction 2 Pointer Arithmetic

More information

Friends and Unary Operators

Friends and Unary Operators Friends and Unary Operators Lecture 11 Sections 11.3, 11.6 Robb T. Koether Hampden-Sydney College Fri, Feb 13, 2015 Robb T. Koether (Hampden-Sydney College) Friends and Unary Operators Fri, Feb 13, 2015

More information

Pointers. Lecture 1 Sections Robb T. Koether. Hampden-Sydney College. Wed, Jan 14, 2015

Pointers. Lecture 1 Sections Robb T. Koether. Hampden-Sydney College. Wed, Jan 14, 2015 Pointers Lecture 1 Sections 10.1-10.2 Robb T. Koether Hampden-Sydney College Wed, Jan 14, 2015 Robb T. Koether (Hampden-Sydney College) Pointers Wed, Jan 14, 2015 1 / 23 1 Pointers 2 Pointer Initialization

More information

The Normal Distribution

The Normal Distribution The Normal Distribution Lecture 20 Section 6.3.1 Robb T. Koether Hampden-Sydney College Wed, Sep 28, 2011 Robb T. Koether (Hampden-Sydney College) The Normal Distribution Wed, Sep 28, 2011 1 / 41 Outline

More information

Total Orders. Lecture 41 Section 8.5. Robb T. Koether. Hampden-Sydney College. Mon, Apr 8, 2013

Total Orders. Lecture 41 Section 8.5. Robb T. Koether. Hampden-Sydney College. Mon, Apr 8, 2013 Total Orders Lecture 41 Section 8.5 Robb T. Koether Hampden-Sydney College Mon, Apr 8, 2013 Robb T. Koether (Hampden-Sydney College) Total Orders Mon, Apr 8, 2013 1 / 30 1 Total Orders 2 Topological Sorting

More information

Recursive Sequences. Lecture 24 Section 5.6. Robb T. Koether. Hampden-Sydney College. Wed, Feb 27, 2013

Recursive Sequences. Lecture 24 Section 5.6. Robb T. Koether. Hampden-Sydney College. Wed, Feb 27, 2013 Recursive Sequences Lecture 24 Section 5.6 Robb T. Koether Hampden-Sydney College Wed, Feb 27, 2013 Robb T. Koether (Hampden-Sydney College) Recursive Sequences Wed, Feb 27, 2013 1 / 21 1 Recursive Sequences

More information

Rotations and Translations

Rotations and Translations Rotations and Translations Lecture 33 Sections 11.3-11.4 Robb T. Koether Hampden-Sydney College Wed, Nov 20, 2013 Robb T. Koether (Hampden-Sydney College) Rotations and Translations Wed, Nov 20, 2013 1

More information

Recursive Linked Lists

Recursive Linked Lists Recursive Linked Lists Lecture 28 Sections 14.1-14.5, 14.7 Robb T. Koether Hampden-Sydney College Fri, Mar 31, 2017 Robb T. Koether (Hampden-Sydney College) Recursive Linked Lists Fri, Mar 31, 2017 1 /

More information

The string Class. Lecture 21 Sections 2.9, 3.9, Robb T. Koether. Wed, Oct 17, Hampden-Sydney College

The string Class. Lecture 21 Sections 2.9, 3.9, Robb T. Koether. Wed, Oct 17, Hampden-Sydney College The string Class Lecture 21 Sections 2.9, 3.9, 3.10 Robb T. Koether Hampden-Sydney College Wed, Oct 17, 2018 Robb T. Koether (Hampden-Sydney College) The string Class Wed, Oct 17, 2018 1 / 18 1 The String

More information

Pointer Arithmetic. Lecture 4 Chapter 10. Robb T. Koether. Hampden-Sydney College. Wed, Jan 25, 2017

Pointer Arithmetic. Lecture 4 Chapter 10. Robb T. Koether. Hampden-Sydney College. Wed, Jan 25, 2017 Pointer Arithmetic Lecture 4 Chapter 10 Robb T. Koether Hampden-Sydney College Wed, Jan 25, 2017 Robb T. Koether (Hampden-Sydney College) Pointer Arithmetic Wed, Jan 25, 2017 1 / 36 1 Pointer Arithmetic

More information

CS559 Computer Graphics Fall 2015

CS559 Computer Graphics Fall 2015 CS559 Computer Graphics Fall 2015 Practice Midterm Exam Time: 2 hrs 1. [XX Y Y % = ZZ%] MULTIPLE CHOICE SECTION. Circle or underline the correct answer (or answers). You do not need to provide a justification

More information

Recognition of Tokens

Recognition of Tokens Recognition of Tokens Lecture 3 Section 3.4 Robb T. Koether Hampden-Sydney College Mon, Jan 19, 2015 Robb T. Koether (Hampden-Sydney College) Recognition of Tokens Mon, Jan 19, 2015 1 / 21 1 A Class of

More information

Programming with OpenGL Shaders I. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico

Programming with OpenGL Shaders I. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico Programming with OpenGL Shaders I Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico 0 Objectives Shader Basics Simple Shaders Vertex shader Fragment shaders 1 Vertex

More information

Copyright Khronos Group 2012 Page 1. Teaching GL. Dave Shreiner Director, Graphics and GPU Computing, ARM 1 December 2012

Copyright Khronos Group 2012 Page 1. Teaching GL. Dave Shreiner Director, Graphics and GPU Computing, ARM 1 December 2012 Copyright Khronos Group 2012 Page 1 Teaching GL Dave Shreiner Director, Graphics and GPU Computing, ARM 1 December 2012 Copyright Khronos Group 2012 Page 2 Agenda Overview of OpenGL family of APIs Comparison

More information

Lecture 6 Sections 4.3, 4.6, 4.7. Wed, Sep 9, 2009

Lecture 6 Sections 4.3, 4.6, 4.7. Wed, Sep 9, 2009 Lecture 6 Sections 4.3, 4.6, 4.7 Hampden-Sydney College Wed, Sep 9, 2009 Outline 1 2 3 4 re are three mutually orthogonal axes: the x-axis, the y-axis, and the z-axis. In the standard viewing position,

More information

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

CSE 167: Lecture #8: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 CSE 167: Introduction to Computer Graphics Lecture #8: GLSL Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 Announcements Homework project #4 due Friday, November 2 nd Introduction:

More information

The Mesh Class. Lecture 26. Robb T. Koether. Wed, Oct 28, Hampden-Sydney College

The Mesh Class. Lecture 26. Robb T. Koether. Wed, Oct 28, Hampden-Sydney College The Mesh Class Lecture 26 Robb T. Koether Hampden-Sydney College Wed, Oct 28, 2015 Robb T. Koether (Hampden-Sydney College) The Mesh Class Wed, Oct 28, 2015 1 / 23 Outline 1 The Mesh Class 2 Assignment

More information

CSE 167: Introduction to Computer Graphics Lecture #7: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016

CSE 167: Introduction to Computer Graphics Lecture #7: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016 CSE 167: Introduction to Computer Graphics Lecture #7: GLSL Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016 Announcements Project 2 due Friday 4/22 at 2pm Midterm #1 on

More information

Lecture 5 Vertex and Fragment Shaders-1. CITS3003 Graphics & Animation

Lecture 5 Vertex and Fragment Shaders-1. CITS3003 Graphics & Animation Lecture 5 Vertex and Fragment Shaders-1 CITS3003 Graphics & Animation E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 Objectives The rendering pipeline and the shaders Data

More information

Street-Routing Problems

Street-Routing Problems Street-Routing Problems Lecture 26 Sections 5.1-5.2 Robb T. Koether Hampden-Sydney College Wed, Oct 25, 2017 Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 1 / 21 1

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

Programming with OpenGL Part 3: Shaders. Ed Angel Professor of Emeritus of Computer Science University of New Mexico

Programming with OpenGL Part 3: Shaders. Ed Angel Professor of Emeritus of Computer Science University of New Mexico Programming with OpenGL Part 3: Shaders Ed Angel Professor of Emeritus of Computer Science University of New Mexico 1 Objectives Simple Shaders - Vertex shader - Fragment shaders Programming shaders with

More information

Implementing Linked Lists

Implementing Linked Lists Implementing Linked Lists Lecture 16 Sections 17.1-17.3 Robb T. Koether Hampden-Sydney College Wed, Feb 27, 2013 Robb T. Koether (Hampden-Sydney College) Implementing Linked Lists Wed, Feb 27, 2013 1 /

More information

The Decreasing-Time Algorithm

The Decreasing-Time Algorithm The Decreasing-Time Algorithm Lecture 36 Sections 8.4 Robb T. Koether Hampden-Sydney College Wed, Apr 18, 2018 Robb T. Koether (Hampden-Sydney College) The Decreasing-Time Algorithm Wed, Apr 18, 2018 1

More information

Lab 2-3D Transformations and Vertex Shaders

Lab 2-3D Transformations and Vertex Shaders Lab 2-3D Transformations and Vertex Shaders Support code: /course/cs1230/src/labs/lab02 Demo: /course/cs1230/bin/cs1230_lab02_demo Intro Last week you learned how to draw 2D shapes in OpenGL using VBOs

More information

SUMMARY. CS380: Introduction to Computer Graphics Projection Chapter 10. Min H. Kim KAIST School of Computing 18/04/12. Smooth Interpolation

SUMMARY. CS380: Introduction to Computer Graphics Projection Chapter 10. Min H. Kim KAIST School of Computing 18/04/12. Smooth Interpolation CS38: Introduction to Computer Graphics Projection Chapter Min H. Kim KAIST School of Computing Smooth Interpolation SUMMARY 2 Cubic Bezier Spline To evaluate the function c(t) at any value of t, we perform

More information

Programming with OpenGL Shaders I. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico

Programming with OpenGL Shaders I. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico Programming with OpenGL Shaders I Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico Objectives Shader Programming Basics Simple Shaders Vertex shader Fragment shaders

More information

The Coefficient of Determination

The Coefficient of Determination The Coefficient of Determination Lecture 46 Section 13.9 Robb T. Koether Hampden-Sydney College Wed, Apr 17, 2012 Robb T. Koether (Hampden-Sydney College) The Coefficient of Determination Wed, Apr 17,

More information

Building Models. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Building Models. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science Building Models CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science 1 Objectives Introduce simple data structures for building polygonal models - Vertex lists - Edge

More information

Computação Gráfica. Computer Graphics Engenharia Informática (11569) 3º ano, 2º semestre. Chap. 4 Windows and Viewports

Computação Gráfica. Computer Graphics Engenharia Informática (11569) 3º ano, 2º semestre. Chap. 4 Windows and Viewports Computação Gráfica Computer Graphics Engenharia Informática (11569) 3º ano, 2º semestre Chap. 4 Windows and Viewports Outline : Basic definitions in 2D: Global coordinates (scene domain): continuous domain

More information

Computer Graphics (CS 4731) Lecture 11: Implementing Transformations. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

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

Stack Applications. Lecture 27 Sections Robb T. Koether. Hampden-Sydney College. Wed, Mar 29, 2017

Stack Applications. Lecture 27 Sections Robb T. Koether. Hampden-Sydney College. Wed, Mar 29, 2017 Stack Applications Lecture 27 Sections 18.7-18.8 Robb T. Koether Hampden-Sydney College Wed, Mar 29, 2017 Robb T. Koether Hampden-Sydney College) Stack Applications Wed, Mar 29, 2017 1 / 27 1 Function

More information

CS 432 Interactive Computer Graphics

CS 432 Interactive Computer Graphics CS 432 Interactive Computer Graphics Lecture 4 3D Viewing Matt Burlick - Drexel University - CS 432 1 Reading Angel Chapters 3-4 Red Book Chapter 5, Appendix E Matt Burlick - Drexel University - CS 432

More information

Displaying Distributions - Quantitative Variables

Displaying Distributions - Quantitative Variables Displaying Distributions - Quantitative Variables Lecture 13 Sections 4.4.1-4.4.3 Robb T. Koether Hampden-Sydney College Wed, Feb 8, 2012 Robb T. Koether (Hampden-Sydney College)Displaying Distributions

More information

INFOGR Computer Graphics

INFOGR Computer Graphics INFOGR Computer Graphics Jacco Bikker & Debabrata Panja - April-July 2017 Lecture 10: Shaders Welcome! INFOGR2016/17 Today s Agenda: Recap: Diffuse Materials The Phong Shading Model Environment

More information

Computer Graphics 7: Viewing in 3-D

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

Pointers. Lecture 2 Sections Robb T. Koether. Hampden-Sydney College. Mon, Jan 20, 2014

Pointers. Lecture 2 Sections Robb T. Koether. Hampden-Sydney College. Mon, Jan 20, 2014 Pointers Lecture 2 Sections 10.3-10.8 Robb T. Koether Hampden-Sydney College Mon, Jan 20, 2014 Robb T. Koether (Hampden-Sydney College) Pointers Mon, Jan 20, 2014 1 / 35 1 Endianness 2 Pointer Arithmetic

More information

Operators. Lecture 12 Section Robb T. Koether. Hampden-Sydney College. Fri, Feb 9, 2018

Operators. Lecture 12 Section Robb T. Koether. Hampden-Sydney College. Fri, Feb 9, 2018 Operators Lecture 12 Section 14.5 Robb T. Koether Hampden-Sydney College Fri, Feb 9, 2018 Robb T. Koether (Hampden-Sydney College) Operators Fri, Feb 9, 2018 1 / 21 Outline 1 Operators as Functions 2 Operator

More information

Dynamic Allocation of Memory

Dynamic Allocation of Memory Dynamic Allocation of Memory Lecture 4 Sections 10.9-10.10 Robb T. Koether Hampden-Sydney College Fri, Jan 25, 2013 Robb T. Koether (Hampden-Sydney College) Dynamic Allocation of Memory Fri, Jan 25, 2013

More information

Mipmaps. Lecture 23 Subsection Fri, Oct 30, Hampden-Sydney College. Mipmaps. Robb T. Koether. Discrete Sampling.

Mipmaps. Lecture 23 Subsection Fri, Oct 30, Hampden-Sydney College. Mipmaps. Robb T. Koether. Discrete Sampling. Lecture 23 Subsection 8.8.2 Hampden-Sydney College Fri, Oct 30, 2009 Outline 1 2 3 4 5 dumay.info Outline 1 2 3 4 5 dumay.info Suppose we are drawing a 2-dimensional black-and-white checkerboard pattern.

More information

Binary Tree Applications

Binary Tree Applications Binary Tree Applications Lecture 30 Section 19.2 Robb T. Koether Hampden-Sydney College Wed, Apr 15, 2015 Robb T. Koether (Hampden-Sydney College) Binary Tree Applications Wed, Apr 15, 2015 1 / 56 1 Binary

More information

Boolean Expressions. Lecture 31 Sections 6.6, 6.7. Robb T. Koether. Hampden-Sydney College. Wed, Apr 8, 2015

Boolean Expressions. Lecture 31 Sections 6.6, 6.7. Robb T. Koether. Hampden-Sydney College. Wed, Apr 8, 2015 Boolean Expressions Lecture 31 Sections 6.6, 6.7 Robb T. Koether Hampden-Sydney College Wed, Apr 8, 2015 Robb T. Koether (Hampden-Sydney College) Boolean Expressions Wed, Apr 8, 2015 1 / 22 1 Relational

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

List Iterator Implementation

List Iterator Implementation List Iterator Implementation Lecture 28 Section 14.6 Robb T. Koether Hampden-Sydney College Fri, Apr 10, 2015 Robb T. Koether (Hampden-Sydney College) List Iterator Implementation Fri, Apr 10, 2015 1 /

More information

OPENGL AND GLSL. Computer Graphics

OPENGL AND GLSL. Computer Graphics OPENGL AND GLSL Computer Graphics 1 OUTLINE I. Detecting GLSL Errors II. Drawing a (gasp) Triangle! III. (Simple) Animation 2 Interactive Computer Graphics, http://www.mechapen.com/projects.html WHAT IS

More information

LR Parsing - The Items

LR Parsing - The Items LR Parsing - The Items Lecture 10 Sections 4.5, 4.7 Robb T. Koether Hampden-Sydney College Fri, Feb 13, 2015 Robb T. Koether (Hampden-Sydney College) LR Parsing - The Items Fri, Feb 13, 2015 1 / 31 1 LR

More information

Computer Graphics Coursework 1

Computer Graphics Coursework 1 Computer Graphics Coursework 1 Deadline Deadline: 4pm, 24/10/2016 4pm 23/10/2015 Outline The aim of the coursework is to modify the vertex and fragment shaders in the provided OpenGL framework to implement

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

Lecture 9 Sections 2.6, 5.1, 5.2. Wed, Sep 16, 2009

Lecture 9 Sections 2.6, 5.1, 5.2. Wed, Sep 16, 2009 Lecture 9 Sections 2.6, 5.1, 5.2 Hampden-Sydney College Wed, Sep 16, 2009 Outline 1 2 3 4 5 6 Controlling 7 Definition () A frustum is a truncated pyramid. Definition ( ) The view frustum is the region

More information

Stacks and their Applications

Stacks and their Applications Stacks and their Applications Lecture 23 Sections 18.1-18.2 Robb T. Koether Hampden-Sydney College Fri, Mar 16, 2018 Robb T. Koether Hampden-Sydney College) Stacks and their Applications Fri, Mar 16, 2018

More information

Basic PHP Lecture 17

Basic PHP Lecture 17 Basic PHP Lecture 17 Robb T. Koether Hampden-Sydney College Fri, Feb 24, 2012 Robb T. Koether (Hampden-Sydney College) Basic PHPLecture 17 Fri, Feb 24, 2012 1 / 30 1 PHP 2 Basic PHP 3 The Extended echo

More information

CS4621/5621 Fall Computer Graphics Practicum Intro to OpenGL/GLSL

CS4621/5621 Fall Computer Graphics Practicum Intro to OpenGL/GLSL CS4621/5621 Fall 2015 Computer Graphics Practicum Intro to OpenGL/GLSL Professor: Kavita Bala Instructor: Nicolas Savva with slides from Balazs Kovacs, Eston Schweickart, Daniel Schroeder, Jiang Huang

More information

INFOGR Computer Graphics

INFOGR Computer Graphics INFOGR Computer Graphics Jacco Bikker & Debabrata Panja - April-July 2018 Lecture 10: Shaders Welcome! Ƹ Ƹ Ƹ x M final = T totorso R T down R = x y z 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 Operations: 1. Translate

More information

Array Lists. Lecture 15. Robb T. Koether. Hampden-Sydney College. Fri, Feb 16, 2018

Array Lists. Lecture 15. Robb T. Koether. Hampden-Sydney College. Fri, Feb 16, 2018 Array Lists Lecture 15 Robb T. Koether Hampden-Sydney College Fri, Feb 16, 2018 Robb T. Koether (Hampden-Sydney College) Array Lists Fri, Feb 16, 2018 1 / 21 1 Inlining Functions 2 List Implementations

More information

Fundamental Data Types

Fundamental Data Types Fundamental Data Types Lecture 4 Sections 2.7-2.10 Robb T. Koether Hampden-Sydney College Mon, Sep 3, 2018 Robb T. Koether (Hampden-Sydney College) Fundamental Data Types Mon, Sep 3, 2018 1 / 25 1 Integers

More information

Computer Viewing. Prof. George Wolberg Dept. of Computer Science City College of New York

Computer Viewing. Prof. George Wolberg Dept. of Computer Science City College of New York Computer Viewing Prof. George Wolberg Dept. of Computer Science City College of New York Objectives Introduce the mathematics of projection Introduce OpenGL viewing functions Look at alternate viewing

More information

The Class Construct Part 2

The Class Construct Part 2 The Class Construct Part 2 Lecture 24 Sections 7.7-7.9 Robb T. Koether Hampden-Sydney College Mon, Oct 29, 2018 Robb T. Koether (Hampden-Sydney College) The Class Construct Part 2 Mon, Oct 29, 2018 1 /

More information

Recursive Descent Parsers

Recursive Descent Parsers Recursive Descent Parsers Lecture 7 Robb T. Koether Hampden-Sydney College Wed, Jan 28, 2015 Robb T. Koether (Hampden-Sydney College) Recursive Descent Parsers Wed, Jan 28, 2015 1 / 18 1 Parsing 2 LL Parsers

More information

Advanced Lighting Techniques Due: Monday November 2 at 10pm

Advanced Lighting Techniques Due: Monday November 2 at 10pm CMSC 23700 Autumn 2015 Introduction to Computer Graphics Project 3 October 20, 2015 Advanced Lighting Techniques Due: Monday November 2 at 10pm 1 Introduction This assignment is the third and final part

More information

XPath. Lecture 36. Robb T. Koether. Wed, Apr 16, Hampden-Sydney College. Robb T. Koether (Hampden-Sydney College) XPath Wed, Apr 16, / 28

XPath. Lecture 36. Robb T. Koether. Wed, Apr 16, Hampden-Sydney College. Robb T. Koether (Hampden-Sydney College) XPath Wed, Apr 16, / 28 XPath Lecture 36 Robb T. Koether Hampden-Sydney College Wed, Apr 16, 2014 Robb T. Koether (Hampden-Sydney College) XPath Wed, Apr 16, 2014 1 / 28 1 XPath 2 Executing XPath Expressions 3 XPath Expressions

More information