SlideShare a Scribd company logo
1 of 56
CS 354 Transformation, Clipping, and Culling Mark Kilgard University of Texas January 31, 2012
Today’s material ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Course Information Reminders ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
My Office Hours ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Last time, this time ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Daily Quiz ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Programmer’s View: OpenGL API Example ,[object Object],glShadeModel ( GL_SMOOTH );  // smooth color interpolation glEnable ( GL_DEPTH_TEST );  // enable hidden surface removal glClear (GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); glBegin (GL_TRIANGLES); {  // every 3 vertexes makes a triangle glColor4ub (255, 0, 0, 255);  // RGBA=(1,0,0,100%) glVertex3f (-0.8,  0.8,  0.3);  // XYZ=(-8/10,8/10,3/10) glColor4ub (0, 255, 0, 255);  // RGBA=(0,1,0,100%) glVertex3f ( 0.8,  0.8, -0.2);  // XYZ=(8/10,8/10,-2/10) glColor4ub (0, 0, 255, 255);  // RGBA=(0,0,1,100%) glVertex3f ( 0.0, -0.8, -0.2);  // XYZ=(0,-8/10,-2/10) }  glEnd (); Pro Tip:  use curly braces to “bracket” nested OpenGL usage; no semantic meaning, just highlights grouping
Programmer’s View: GLUT API Example ,[object Object],#include <GL/glut.h>  // includes necessary OpenGL headers void display() { // <<  insert code on prior slide here  >> glutSwapBuffers (); } void main(int argc, char **argv) {   // request double-buffered color window with depth buffer glutInitDisplayMode ( GLUT_RGBA  |  GLUT_DOUBLE  |  GLUT_DEPTH ); glutInit (&argc, argv); glutCreateWindow (“simple triangle”); glutDisplayFunc (display);  // function to render window glutMainLoop (); } FYI:  GLUT = OpenGL Utility Toolkit
A Simplified Graphics Pipeline Application Vertex batching & assembly Triangle assembly Triangle clipping Triangle rasterization Fragment shading Depth testing Color update Application- OpenGL API boundary  Framebuffer NDC to window space Depth buffer several operations left out for simplicity in explaining the simple_triangle example
A few more steps expanded Application Vertex batching & assembly Lighting View frustum clipping Triangle rasterization Fragment shading Depth testing Color update Application- OpenGL API boundary  Framebuffer NDC to window space Depth buffer Vertex transformation User defined clipping Back face culling Perspective divide Triangle assembly Texture coordinate generation was just “triangle clipping”  before
Conceptual Vertex Transformation glVertex* API commands Modelview matrix User-defined clip planes View-frustum clip planes to primitive rasterization object-space coordinates  (x o ,y o ,z o ,w o )  eye-space coordinates  (x e ,y e ,z e ,w e ) clipped eye-space coordinates  clipped clip-space  coordinates  Perspective division Projection matrix Viewport + Depth Range transformation (x c ,y c ,z c ,w c ) window-space coordinates  (x w ,y w ,z w ,1/w c ) normalized device coordinates (NDC) (x n ,y n ,z n ,1/w c ) clip-space coordinates  (x c ,y c ,z c ,w c ) (x e ,y e ,z e ,w e ) (x e ,y e ,z e ,w e )
User Clip Planes in Practice [ParaView] [IVoR] Primarily used scientific visualization and Computer Aided Design (CAD) applications
Remember Back to clipspace Example Six user-defined clip planes enabled to clip teapot to left scene’s clip space view Without user clip planes
Four-component positions! ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example, All Identical Positions ,[object Object],[object Object],[object Object],[object Object],(2,-5,10) (2,-5,10,1) (4,-10,20,2) (1,-2.5,5,0.5) (-2,5,-10,-1)
Affine  View Frustum Clip Equations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Projective  View Frustum Clip Equations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
glVertex3f Generalized ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Vertex Transformation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Vertex Transformation ,[object Object],[object Object]
Matrix Multiplication ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Two Transforms in Sequence ,[object Object],FIRST object-space to eye-space SECOND eye-space to clip-space 16 Multiply-Add operations Another 16 Multiply-Add operations
Modelview-Projection Transform ,[object Object],[object Object],[object Object],concatenation is 64 Multiply-Add operations, done by OpenGL driver Matrix multiplication is  associative  (but not commutative) A(BC) = (AB)C, but ABC≠CBA
Setting the Modelview and Projection Matrices ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Careful:  Beware of Selectors ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Many Matrix Manipulation Commands ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],OpenGL API convention f-suffixed means takes single-precision float parameters d-suffixed means takes double-precision parameters Examples:  glTranslate d ,  glScale d ,  glRotate d
EXT_direct_state_access Versions of Matrix Commands Convetions All  f -suffixed entry points have  d -suffixed versions for double precision too All selector-free routines take a GLenum  matrix mode parameter, same as  glMatrixMode glMatrixMultTransposefEXT glMultTransposeMatrixf glMatrixLoadTransposefEXT glLoadTransposeMatrixf glMatrixPopEXT glPopMatrix glMatrixPushEXT glPushMatrix glMatrixFrustumEXT glFrustumf glMatrixOrthoEXT glOrthof glMatrixTranslatefEXT glTranslatef glMatrixScalefEXT glScalef glMatrixRotatefEXT glRotatef glMatrixLoadIdentityEXT glLoadIdentity glMatrixMultfEXT glMultMatrixf glMatrixLoadfEXT glLoadMatrixf Selector-free DSA Command Conventional Command
Scale, Rotate, and Translate Example ,[object Object],glShadeModel ( GL_SMOOTH );  // smooth color interpolation glEnable ( GL_DEPTH_TEST );  // enable hidden surface removal glMatrixMode ( GL_MODELVIEW ); glLoadIdentity ();   // reset to null transform glScalef (0.7, 0.4, 1.0);   // scale by 70% in X and 40% in Y (and 100% in Z) glRotatef (30, 0, 0, 1);   // rotate in XY plane (around Z axis) 30 degrees glTranslatef (-0.1, 0.3, 0.1); // shift -0.1 to the left and 0.3 up (and 0.1 back in Z) glClear (GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); glBegin (GL_TRIANGLES); {  // every 3 vertexes makes a triangle glColor4ub (255, 0, 0, 255);  // RGBA=(1,0,0,100%) glVertex3f (-0.8,  0.8,  0.3);  // XYZ=(-8/10,8/10,3/10) glColor4ub (0, 255, 0, 255);  // RGBA=(0,1,0,100%) glVertex3f ( 0.8,  0.8, -0.2);  // XYZ=(8/10,8/10,-2/10) glColor4ub (0, 0, 255, 255);  // RGBA=(0,0,1,100%) glVertex3f ( 0.0, -0.8, -0.2);  // XYZ=(0,-8/10,-2/10) }  glEnd ();
Load Identity Transform ,[object Object],[object Object],[object Object]
Non-uniform Scale Transform ,[object Object],[object Object],[object Object]
Translate Transform ,[object Object],[object Object],[object Object]
Rotation Transform ,[object Object],[object Object],[object Object],glRotatef (a,1,0,0)  glRotatef (a,0,1,0)  glRotatef (a,0,0,1)  Axis could be arbitrary un-normalized direction vector
Orthographic Transform ,[object Object],[object Object],[object Object]
Frustum Transform ,[object Object],[object Object],[object Object]
Two Transforms Concatenated ,[object Object],[object Object],[object Object],[object Object],Just 16 Multiply-Add operations… even though 2 (combined) transformation matrices!
Perspective Divide ,[object Object],[object Object],[object Object],[object Object],[object Object]
Viewport and Depth Range ,[object Object],[object Object],[object Object],[object Object],[object Object]
Conceptual Vertex Transformation glVertex* API commands Modelview matrix User-defined clip planes View-frustum clip planes to primitive rasterization object-space coordinates  (x o ,y o ,z o ,w o )  eye-space coordinates  (x e ,y e ,z e ,w e ) clipped eye-space coordinates  clipped clip-space  coordinates  Perspective division Projection matrix Viewport + Depth Range transformation (x c ,y c ,z c ,w c ) window-space coordinates  (x w ,y w ,z w ,1/w c ) normalized device coordinates (NDC) (x n ,y n ,z n ,1/w c ) clip-space coordinates  (x c ,y c ,z c ,w c ) (x e ,y e ,z e ,w e ) (x e ,y e ,z e ,w e )
View Frustum Clipping Generalizes Cleanly ,[object Object],[object Object],(-1.8,  0.8, 0.3, 1) (-0.8,  0.8, -0.2,1) (0, -0.8, -0.2, 1) origin at (0,0,0,1)   
Clipped Triangle Visualized Clipped and Rasterized Normally Visualization of NDC space Notice triangle is “poking out” of the cube; this is the reason that should be clipped
Break Clipped Triangle into Two Triangles But how do we find these “new” vertices? The edge clipping the triangle is the line at X = -1 so we know X = -1 at these points—but what about Y?
Use Ratios to Interpolate Clipped Positions (-1.8,  0.8, 0.3, 1) (-0.8,  0.8, -0.2,1) (0, -0.8, -0.2) origin at (0,0,0,1) X = -1 Y = (1.8/2.6)×0.8 + (0.8/2.6)×0.8 = 0.8 Z = (1.8/2.6)×0.3 + (0.8/2.6)×-0.2 = 0.1461538 W = (1.8/2.6)×1 + (0.8/2.6)×1 = 1 -1-(-1.8)=0.8 0.8-(-1)=1.8 0.8-(-1.8)=2.6 (-1,0.8,0.146153,1) Straightforward because all the edges are orthogonal Weights: 1.8/2.6 0.8/2.6, sum to 1
Use Ratios to Interpolate Clipped Positions (-1.8,  0.8, 0.3) (-0.8,  0.8, -0.2) (0, -0.8, -0.2) origin at (0,0,0) 0-(-1.8) = 1.8 0-(-1) = 1 X = -1 Y = (1/1.8)×0.8 + (0.8/1.8)×-0.8 = 0.08888…  Z = (1/1.8)×0.3 + (0.8/1.8)×-0.2 = 0.07777… (-1,0.0888,0.0777) -1-(-1.8) = 0.8 Weights: 1/1.8  0.8/1.8, sum to 1
Generalize to Non-1 W ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
View Frustum Plane Equations ,[object Object],-1 z c  + 1w c  ≥ 0  1 -1 0 0 Top 1 z c  + 1w c  ≥ 0 1 1 0 0 Near -1 y c  + 1w c  ≥ 0  1 0 -1 0 Top 1 y c  + 1w c  ≥ 0 1 0 1 0 Bottom -1 x c  + 1w c  ≥ 0  1 0 0 -1 Right 1 x c  + 1w c  ≥ 0 1 0 0 1 Left Plane equation D C B A Name
Projective Clipping ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Readily Extends to User-defined Clip Planes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
(Clip) Plane Transformation ,[object Object],[object Object],glClipPlane  parameters glVertex4f parameters
Conceptual Vertex Transformation glVertex* API commands Modelview matrix User-defined clip planes View-frustum clip planes to primitive rasterization object-space coordinates  (x o ,y o ,z o ,w o )  eye-space coordinates  (x e ,y e ,z e ,w e ) clipped eye-space coordinates  clipped clip-space  coordinates  Perspective division Projection matrix Viewport + Depth Range transformation (x c ,y c ,z c ,w c ) window-space coordinates  (x w ,y w ,z w ,w w ) normalized device coordinates (NDC) (x n ,y n ,z n ,w n ) clip-space coordinates  (x c ,y c ,z c ,w c ) (x e ,y e ,z e ,w e ) (x e ,y e ,z e ,w e )
Vertex Shaders in the Pipeline Geometry Program 3D Application or Game OpenGL API GPU Front End Vertex Assembly Vertex Shader Clipping, Setup, and Rasterization Fragment Shader Texture Fetch Raster Operations Framebuffer Access Memory Interface CPU – GPU Boundary OpenGL 3.3 Attribute Fetch Primitive Assembly Parameter Buffer Read programmable fixed-function Legend So far, we’ve discussed “fixed-function” vertex transformation Modern GPUs make vertex processing  programmable Via vertex shaders!
Vertex Programmability Paletted matrix skinning Twister vertex program Per-vertex cartoon shading
Other Vertex Processing Tasks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Vertex Shader Example: Key Frame Blending Frame A Frame B Blended Frame 47% = + 53%
Key Frame Blending Vertex Shader Frame A Frame B Other possible key frames
Non-linear Vertex Transform + Fragment Shader Setup Fragment program Vertex program 2D grid over (s,t)  [0,1] Tessellated torus
Next Lecture ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2nd homework is on class web site, 5 pages, 10 problems

More Related Content

What's hot

Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphicsPartnered Health
 
Ajay ppt region segmentation new copy
Ajay ppt region segmentation new   copyAjay ppt region segmentation new   copy
Ajay ppt region segmentation new copyAjay Kumar Singh
 
CS 354 Texture Mapping
CS 354 Texture MappingCS 354 Texture Mapping
CS 354 Texture MappingMark Kilgard
 
Graphics_3D viewing
Graphics_3D viewingGraphics_3D viewing
Graphics_3D viewingRabin BK
 
Morphological image processing
Morphological image processingMorphological image processing
Morphological image processingRaghu Kumar
 
Hidden surface removal algorithm
Hidden surface removal algorithmHidden surface removal algorithm
Hidden surface removal algorithmKKARUNKARTHIK
 
3 d viewing projection
3 d viewing  projection3 d viewing  projection
3 d viewing projectionPooja Dixit
 
Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)Tiago Sousa
 
Computer Vision: Shape from Specularities and Motion
Computer Vision: Shape from Specularities and MotionComputer Vision: Shape from Specularities and Motion
Computer Vision: Shape from Specularities and MotionDamian T. Gordon
 
morphological image processing
morphological image processingmorphological image processing
morphological image processingJohn Williams
 
Projection In Computer Graphics
Projection In Computer GraphicsProjection In Computer Graphics
Projection In Computer GraphicsSanu Philip
 
AlexNet(ImageNet Classification with Deep Convolutional Neural Networks)
AlexNet(ImageNet Classification with Deep Convolutional Neural Networks)AlexNet(ImageNet Classification with Deep Convolutional Neural Networks)
AlexNet(ImageNet Classification with Deep Convolutional Neural Networks)Fellowship at Vodafone FutureLab
 

What's hot (20)

Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphics
 
Lecture-11.pdf
Lecture-11.pdfLecture-11.pdf
Lecture-11.pdf
 
Bresenham circle
Bresenham circleBresenham circle
Bresenham circle
 
Dip chapter 2
Dip chapter 2Dip chapter 2
Dip chapter 2
 
Polygon mesh
Polygon  meshPolygon  mesh
Polygon mesh
 
Ajay ppt region segmentation new copy
Ajay ppt region segmentation new   copyAjay ppt region segmentation new   copy
Ajay ppt region segmentation new copy
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
CS 354 Texture Mapping
CS 354 Texture MappingCS 354 Texture Mapping
CS 354 Texture Mapping
 
Graphics_3D viewing
Graphics_3D viewingGraphics_3D viewing
Graphics_3D viewing
 
Morphological image processing
Morphological image processingMorphological image processing
Morphological image processing
 
Polygon mesh
Polygon meshPolygon mesh
Polygon mesh
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Hidden surface removal algorithm
Hidden surface removal algorithmHidden surface removal algorithm
Hidden surface removal algorithm
 
3 d viewing projection
3 d viewing  projection3 d viewing  projection
3 d viewing projection
 
Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)
 
Computer Vision: Shape from Specularities and Motion
Computer Vision: Shape from Specularities and MotionComputer Vision: Shape from Specularities and Motion
Computer Vision: Shape from Specularities and Motion
 
morphological image processing
morphological image processingmorphological image processing
morphological image processing
 
Projection In Computer Graphics
Projection In Computer GraphicsProjection In Computer Graphics
Projection In Computer Graphics
 
AlexNet(ImageNet Classification with Deep Convolutional Neural Networks)
AlexNet(ImageNet Classification with Deep Convolutional Neural Networks)AlexNet(ImageNet Classification with Deep Convolutional Neural Networks)
AlexNet(ImageNet Classification with Deep Convolutional Neural Networks)
 
raycasting. ppt
raycasting. pptraycasting. ppt
raycasting. ppt
 

Viewers also liked

OpenGL Transformation
OpenGL TransformationOpenGL Transformation
OpenGL TransformationSandip Jadhav
 
Homogeneous coordinate
Homogeneous coordinateHomogeneous coordinate
Homogeneous coordinateBed Dhakal
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologyTiago Sousa
 
2 d transformations and homogeneous coordinates
2 d transformations and homogeneous coordinates2 d transformations and homogeneous coordinates
2 d transformations and homogeneous coordinatesTarun Gehlot
 
3d transformation computer graphics
3d transformation computer graphics 3d transformation computer graphics
3d transformation computer graphics University of Potsdam
 

Viewers also liked (8)

Projection Matrices
Projection MatricesProjection Matrices
Projection Matrices
 
3D transformation
3D transformation3D transformation
3D transformation
 
OpenGL Transformation
OpenGL TransformationOpenGL Transformation
OpenGL Transformation
 
Homogeneous coordinate
Homogeneous coordinateHomogeneous coordinate
Homogeneous coordinate
 
Secrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics TechnologySecrets of CryENGINE 3 Graphics Technology
Secrets of CryENGINE 3 Graphics Technology
 
2 d transformations and homogeneous coordinates
2 d transformations and homogeneous coordinates2 d transformations and homogeneous coordinates
2 d transformations and homogeneous coordinates
 
2d/3D transformations in computer graphics(Computer graphics Tutorials)
2d/3D transformations in computer graphics(Computer graphics Tutorials)2d/3D transformations in computer graphics(Computer graphics Tutorials)
2d/3D transformations in computer graphics(Computer graphics Tutorials)
 
3d transformation computer graphics
3d transformation computer graphics 3d transformation computer graphics
3d transformation computer graphics
 

Similar to CS 354 Graphics Math and Transformations

CS 354 Object Viewing and Representation
CS 354 Object Viewing and RepresentationCS 354 Object Viewing and Representation
CS 354 Object Viewing and RepresentationMark Kilgard
 
CS 354 More Graphics Pipeline
CS 354 More Graphics PipelineCS 354 More Graphics Pipeline
CS 354 More Graphics PipelineMark Kilgard
 
CS 354 Pixel Updating
CS 354 Pixel UpdatingCS 354 Pixel Updating
CS 354 Pixel UpdatingMark Kilgard
 
2 transformation computer graphics
2 transformation computer graphics2 transformation computer graphics
2 transformation computer graphicscairo university
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...ICS
 
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeksBeginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeksJinTaek Seo
 
Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5Takao Wada
 
Shadow Volumes on Programmable Graphics Hardware
Shadow Volumes on Programmable Graphics HardwareShadow Volumes on Programmable Graphics Hardware
Shadow Volumes on Programmable Graphics Hardwarestefan_b
 
Advanced Game Development with the Mobile 3D Graphics API
Advanced Game Development with the Mobile 3D Graphics APIAdvanced Game Development with the Mobile 3D Graphics API
Advanced Game Development with the Mobile 3D Graphics APITomi Aarnio
 
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdfCD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdfRajJain516913
 
Trident International Graphics Workshop 2014 4/5
Trident International Graphics Workshop 2014 4/5Trident International Graphics Workshop 2014 4/5
Trident International Graphics Workshop 2014 4/5Takao Wada
 
Parallel Computing 2007: Bring your own parallel application
Parallel Computing 2007: Bring your own parallel applicationParallel Computing 2007: Bring your own parallel application
Parallel Computing 2007: Bring your own parallel applicationGeoffrey Fox
 
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxSAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxanhlodge
 
CS 354 Viewing Stuff
CS 354 Viewing StuffCS 354 Viewing Stuff
CS 354 Viewing StuffMark Kilgard
 
openFrameworks 007 - 3D
openFrameworks 007 - 3DopenFrameworks 007 - 3D
openFrameworks 007 - 3Droxlu
 

Similar to CS 354 Graphics Math and Transformations (20)

CS 354 Object Viewing and Representation
CS 354 Object Viewing and RepresentationCS 354 Object Viewing and Representation
CS 354 Object Viewing and Representation
 
CS 354 More Graphics Pipeline
CS 354 More Graphics PipelineCS 354 More Graphics Pipeline
CS 354 More Graphics Pipeline
 
CS 354 Pixel Updating
CS 354 Pixel UpdatingCS 354 Pixel Updating
CS 354 Pixel Updating
 
2 transformation computer graphics
2 transformation computer graphics2 transformation computer graphics
2 transformation computer graphics
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
 
OpenGL Transformations
OpenGL TransformationsOpenGL Transformations
OpenGL Transformations
 
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeksBeginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
 
Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5
 
Bai 1
Bai 1Bai 1
Bai 1
 
Shadow Volumes on Programmable Graphics Hardware
Shadow Volumes on Programmable Graphics HardwareShadow Volumes on Programmable Graphics Hardware
Shadow Volumes on Programmable Graphics Hardware
 
Advanced Game Development with the Mobile 3D Graphics API
Advanced Game Development with the Mobile 3D Graphics APIAdvanced Game Development with the Mobile 3D Graphics API
Advanced Game Development with the Mobile 3D Graphics API
 
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdfCD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
 
Trident International Graphics Workshop 2014 4/5
Trident International Graphics Workshop 2014 4/5Trident International Graphics Workshop 2014 4/5
Trident International Graphics Workshop 2014 4/5
 
slides.07.pptx
slides.07.pptxslides.07.pptx
slides.07.pptx
 
Parallel Computing 2007: Bring your own parallel application
Parallel Computing 2007: Bring your own parallel applicationParallel Computing 2007: Bring your own parallel application
Parallel Computing 2007: Bring your own parallel application
 
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxSAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
 
CS 354 Viewing Stuff
CS 354 Viewing StuffCS 354 Viewing Stuff
CS 354 Viewing Stuff
 
openFrameworks 007 - 3D
openFrameworks 007 - 3DopenFrameworks 007 - 3D
openFrameworks 007 - 3D
 
Praseed Pai
Praseed PaiPraseed Pai
Praseed Pai
 
Drawing Tools
Drawing ToolsDrawing Tools
Drawing Tools
 

More from Mark Kilgard

D11: a high-performance, protocol-optional, transport-optional, window system...
D11: a high-performance, protocol-optional, transport-optional, window system...D11: a high-performance, protocol-optional, transport-optional, window system...
D11: a high-performance, protocol-optional, transport-optional, window system...Mark Kilgard
 
Computers, Graphics, Engineering, Math, and Video Games for High School Students
Computers, Graphics, Engineering, Math, and Video Games for High School StudentsComputers, Graphics, Engineering, Math, and Video Games for High School Students
Computers, Graphics, Engineering, Math, and Video Games for High School StudentsMark Kilgard
 
NVIDIA OpenGL and Vulkan Support for 2017
NVIDIA OpenGL and Vulkan Support for 2017NVIDIA OpenGL and Vulkan Support for 2017
NVIDIA OpenGL and Vulkan Support for 2017Mark Kilgard
 
NVIDIA OpenGL 4.6 in 2017
NVIDIA OpenGL 4.6 in 2017NVIDIA OpenGL 4.6 in 2017
NVIDIA OpenGL 4.6 in 2017Mark Kilgard
 
NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016Mark Kilgard
 
Virtual Reality Features of NVIDIA GPUs
Virtual Reality Features of NVIDIA GPUsVirtual Reality Features of NVIDIA GPUs
Virtual Reality Features of NVIDIA GPUsMark Kilgard
 
Migrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMigrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMark Kilgard
 
EXT_window_rectangles
EXT_window_rectanglesEXT_window_rectangles
EXT_window_rectanglesMark Kilgard
 
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...Mark Kilgard
 
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware PipelineAccelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware PipelineMark Kilgard
 
NV_path rendering Functional Improvements
NV_path rendering Functional ImprovementsNV_path rendering Functional Improvements
NV_path rendering Functional ImprovementsMark Kilgard
 
OpenGL 4.5 Update for NVIDIA GPUs
OpenGL 4.5 Update for NVIDIA GPUsOpenGL 4.5 Update for NVIDIA GPUs
OpenGL 4.5 Update for NVIDIA GPUsMark Kilgard
 
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path RenderingSIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path RenderingMark Kilgard
 
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and BeyondSIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and BeyondMark Kilgard
 
Programming with NV_path_rendering: An Annex to the SIGGRAPH Asia 2012 paper...
Programming with NV_path_rendering:  An Annex to the SIGGRAPH Asia 2012 paper...Programming with NV_path_rendering:  An Annex to the SIGGRAPH Asia 2012 paper...
Programming with NV_path_rendering: An Annex to the SIGGRAPH Asia 2012 paper...Mark Kilgard
 
GPU accelerated path rendering fastforward
GPU accelerated path rendering fastforwardGPU accelerated path rendering fastforward
GPU accelerated path rendering fastforwardMark Kilgard
 
GPU-accelerated Path Rendering
GPU-accelerated Path RenderingGPU-accelerated Path Rendering
GPU-accelerated Path RenderingMark Kilgard
 
SIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
SIGGRAPH 2012: GPU-Accelerated 2D and Web RenderingSIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
SIGGRAPH 2012: GPU-Accelerated 2D and Web RenderingMark Kilgard
 
SIGGRAPH 2012: NVIDIA OpenGL for 2012
SIGGRAPH 2012: NVIDIA OpenGL for 2012SIGGRAPH 2012: NVIDIA OpenGL for 2012
SIGGRAPH 2012: NVIDIA OpenGL for 2012Mark Kilgard
 

More from Mark Kilgard (20)

D11: a high-performance, protocol-optional, transport-optional, window system...
D11: a high-performance, protocol-optional, transport-optional, window system...D11: a high-performance, protocol-optional, transport-optional, window system...
D11: a high-performance, protocol-optional, transport-optional, window system...
 
Computers, Graphics, Engineering, Math, and Video Games for High School Students
Computers, Graphics, Engineering, Math, and Video Games for High School StudentsComputers, Graphics, Engineering, Math, and Video Games for High School Students
Computers, Graphics, Engineering, Math, and Video Games for High School Students
 
NVIDIA OpenGL and Vulkan Support for 2017
NVIDIA OpenGL and Vulkan Support for 2017NVIDIA OpenGL and Vulkan Support for 2017
NVIDIA OpenGL and Vulkan Support for 2017
 
NVIDIA OpenGL 4.6 in 2017
NVIDIA OpenGL 4.6 in 2017NVIDIA OpenGL 4.6 in 2017
NVIDIA OpenGL 4.6 in 2017
 
NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016
 
Virtual Reality Features of NVIDIA GPUs
Virtual Reality Features of NVIDIA GPUsVirtual Reality Features of NVIDIA GPUs
Virtual Reality Features of NVIDIA GPUs
 
Migrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMigrating from OpenGL to Vulkan
Migrating from OpenGL to Vulkan
 
EXT_window_rectangles
EXT_window_rectanglesEXT_window_rectangles
EXT_window_rectangles
 
OpenGL for 2015
OpenGL for 2015OpenGL for 2015
OpenGL for 2015
 
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
 
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware PipelineAccelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
 
NV_path rendering Functional Improvements
NV_path rendering Functional ImprovementsNV_path rendering Functional Improvements
NV_path rendering Functional Improvements
 
OpenGL 4.5 Update for NVIDIA GPUs
OpenGL 4.5 Update for NVIDIA GPUsOpenGL 4.5 Update for NVIDIA GPUs
OpenGL 4.5 Update for NVIDIA GPUs
 
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path RenderingSIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
 
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and BeyondSIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
 
Programming with NV_path_rendering: An Annex to the SIGGRAPH Asia 2012 paper...
Programming with NV_path_rendering:  An Annex to the SIGGRAPH Asia 2012 paper...Programming with NV_path_rendering:  An Annex to the SIGGRAPH Asia 2012 paper...
Programming with NV_path_rendering: An Annex to the SIGGRAPH Asia 2012 paper...
 
GPU accelerated path rendering fastforward
GPU accelerated path rendering fastforwardGPU accelerated path rendering fastforward
GPU accelerated path rendering fastforward
 
GPU-accelerated Path Rendering
GPU-accelerated Path RenderingGPU-accelerated Path Rendering
GPU-accelerated Path Rendering
 
SIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
SIGGRAPH 2012: GPU-Accelerated 2D and Web RenderingSIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
SIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
 
SIGGRAPH 2012: NVIDIA OpenGL for 2012
SIGGRAPH 2012: NVIDIA OpenGL for 2012SIGGRAPH 2012: NVIDIA OpenGL for 2012
SIGGRAPH 2012: NVIDIA OpenGL for 2012
 

Recently uploaded

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

CS 354 Graphics Math and Transformations

  • 1. CS 354 Transformation, Clipping, and Culling Mark Kilgard University of Texas January 31, 2012
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. A Simplified Graphics Pipeline Application Vertex batching & assembly Triangle assembly Triangle clipping Triangle rasterization Fragment shading Depth testing Color update Application- OpenGL API boundary Framebuffer NDC to window space Depth buffer several operations left out for simplicity in explaining the simple_triangle example
  • 10. A few more steps expanded Application Vertex batching & assembly Lighting View frustum clipping Triangle rasterization Fragment shading Depth testing Color update Application- OpenGL API boundary Framebuffer NDC to window space Depth buffer Vertex transformation User defined clipping Back face culling Perspective divide Triangle assembly Texture coordinate generation was just “triangle clipping” before
  • 11. Conceptual Vertex Transformation glVertex* API commands Modelview matrix User-defined clip planes View-frustum clip planes to primitive rasterization object-space coordinates (x o ,y o ,z o ,w o ) eye-space coordinates (x e ,y e ,z e ,w e ) clipped eye-space coordinates clipped clip-space coordinates Perspective division Projection matrix Viewport + Depth Range transformation (x c ,y c ,z c ,w c ) window-space coordinates (x w ,y w ,z w ,1/w c ) normalized device coordinates (NDC) (x n ,y n ,z n ,1/w c ) clip-space coordinates (x c ,y c ,z c ,w c ) (x e ,y e ,z e ,w e ) (x e ,y e ,z e ,w e )
  • 12. User Clip Planes in Practice [ParaView] [IVoR] Primarily used scientific visualization and Computer Aided Design (CAD) applications
  • 13. Remember Back to clipspace Example Six user-defined clip planes enabled to clip teapot to left scene’s clip space view Without user clip planes
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27. EXT_direct_state_access Versions of Matrix Commands Convetions All f -suffixed entry points have d -suffixed versions for double precision too All selector-free routines take a GLenum matrix mode parameter, same as glMatrixMode glMatrixMultTransposefEXT glMultTransposeMatrixf glMatrixLoadTransposefEXT glLoadTransposeMatrixf glMatrixPopEXT glPopMatrix glMatrixPushEXT glPushMatrix glMatrixFrustumEXT glFrustumf glMatrixOrthoEXT glOrthof glMatrixTranslatefEXT glTranslatef glMatrixScalefEXT glScalef glMatrixRotatefEXT glRotatef glMatrixLoadIdentityEXT glLoadIdentity glMatrixMultfEXT glMultMatrixf glMatrixLoadfEXT glLoadMatrixf Selector-free DSA Command Conventional Command
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38. Conceptual Vertex Transformation glVertex* API commands Modelview matrix User-defined clip planes View-frustum clip planes to primitive rasterization object-space coordinates (x o ,y o ,z o ,w o ) eye-space coordinates (x e ,y e ,z e ,w e ) clipped eye-space coordinates clipped clip-space coordinates Perspective division Projection matrix Viewport + Depth Range transformation (x c ,y c ,z c ,w c ) window-space coordinates (x w ,y w ,z w ,1/w c ) normalized device coordinates (NDC) (x n ,y n ,z n ,1/w c ) clip-space coordinates (x c ,y c ,z c ,w c ) (x e ,y e ,z e ,w e ) (x e ,y e ,z e ,w e )
  • 39.
  • 40. Clipped Triangle Visualized Clipped and Rasterized Normally Visualization of NDC space Notice triangle is “poking out” of the cube; this is the reason that should be clipped
  • 41. Break Clipped Triangle into Two Triangles But how do we find these “new” vertices? The edge clipping the triangle is the line at X = -1 so we know X = -1 at these points—but what about Y?
  • 42. Use Ratios to Interpolate Clipped Positions (-1.8, 0.8, 0.3, 1) (-0.8, 0.8, -0.2,1) (0, -0.8, -0.2) origin at (0,0,0,1) X = -1 Y = (1.8/2.6)×0.8 + (0.8/2.6)×0.8 = 0.8 Z = (1.8/2.6)×0.3 + (0.8/2.6)×-0.2 = 0.1461538 W = (1.8/2.6)×1 + (0.8/2.6)×1 = 1 -1-(-1.8)=0.8 0.8-(-1)=1.8 0.8-(-1.8)=2.6 (-1,0.8,0.146153,1) Straightforward because all the edges are orthogonal Weights: 1.8/2.6 0.8/2.6, sum to 1
  • 43. Use Ratios to Interpolate Clipped Positions (-1.8, 0.8, 0.3) (-0.8, 0.8, -0.2) (0, -0.8, -0.2) origin at (0,0,0) 0-(-1.8) = 1.8 0-(-1) = 1 X = -1 Y = (1/1.8)×0.8 + (0.8/1.8)×-0.8 = 0.08888… Z = (1/1.8)×0.3 + (0.8/1.8)×-0.2 = 0.07777… (-1,0.0888,0.0777) -1-(-1.8) = 0.8 Weights: 1/1.8 0.8/1.8, sum to 1
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49. Conceptual Vertex Transformation glVertex* API commands Modelview matrix User-defined clip planes View-frustum clip planes to primitive rasterization object-space coordinates (x o ,y o ,z o ,w o ) eye-space coordinates (x e ,y e ,z e ,w e ) clipped eye-space coordinates clipped clip-space coordinates Perspective division Projection matrix Viewport + Depth Range transformation (x c ,y c ,z c ,w c ) window-space coordinates (x w ,y w ,z w ,w w ) normalized device coordinates (NDC) (x n ,y n ,z n ,w n ) clip-space coordinates (x c ,y c ,z c ,w c ) (x e ,y e ,z e ,w e ) (x e ,y e ,z e ,w e )
  • 50. Vertex Shaders in the Pipeline Geometry Program 3D Application or Game OpenGL API GPU Front End Vertex Assembly Vertex Shader Clipping, Setup, and Rasterization Fragment Shader Texture Fetch Raster Operations Framebuffer Access Memory Interface CPU – GPU Boundary OpenGL 3.3 Attribute Fetch Primitive Assembly Parameter Buffer Read programmable fixed-function Legend So far, we’ve discussed “fixed-function” vertex transformation Modern GPUs make vertex processing programmable Via vertex shaders!
  • 51. Vertex Programmability Paletted matrix skinning Twister vertex program Per-vertex cartoon shading
  • 52.
  • 53. Vertex Shader Example: Key Frame Blending Frame A Frame B Blended Frame 47% = + 53%
  • 54. Key Frame Blending Vertex Shader Frame A Frame B Other possible key frames
  • 55. Non-linear Vertex Transform + Fragment Shader Setup Fragment program Vertex program 2D grid over (s,t)  [0,1] Tessellated torus
  • 56.