Deutsche Börse Group’s T7 - Cash Markets T7 Trader, Admin ...
CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection...
Transcript of CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection...
![Page 1: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/1.jpg)
L:CC, MI:ERSI
CG – T7 - Projection
Miguel Tavares Coimbra
(course and slides designed by
Verónica Costa Orvalho)
![Page 2: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/2.jpg)
Basic steps for creating a 2D image
out of a 3D world
CG 12/13 - T7
• Create the 3D world
– Vertexes and triangles in a 3D space
• Project it to a 2D ‘camera’
– Use perspective to transform coordinates into a
2D space
• Paint each pixel of the 2D image
– Rasterization, shading, texturing
– Will break this into smaller things later on
• Enjoy the super cool image you have created
Today
![Page 3: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/3.jpg)
How do we get 2D images out
of a 3D world?
![Page 4: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/4.jpg)
pipeline
. collision detection
. animation global acceleration . physics simulation process on CPU or GPU
. transformation
. projection Computes: . what is to be drawn . how should be drawn . where should be drawn process on GPU
. draws images generated by geometry stage process on GPU CG 12/13 - T7
![Page 5: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/5.jpg)
CG 12/13 - T7
![Page 6: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/6.jpg)
CG 12/13 - T7
One possibility: Ray tracing
for each pixel {
compute viewing ray
intersect ray with scene
compute illumination at visible point
put result into image
}
Adapted from Steve Marschner, Cornell University
![Page 7: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/7.jpg)
Another one: Projection
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 8: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/8.jpg)
CG 12/13 - T7
Projection in photography
1544
Camera Obscura, Gemma Frisius, 1544
![Page 9: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/9.jpg)
CG 12/13 - T7
Lens based projection
1544 1568
Lens Based Camera Obscura, 1568
![Page 10: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/10.jpg)
Ray tracing vs. Projection
• Viewing in ray tracing – start with image point
– compute ray that projects to that point
– do this using geometry
• Viewing by projection – start with 3D point
– compute image point that it projects to
– do this using transforms
• Inverse processes – ray gen. computes the preimage of projection
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 11: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/11.jpg)
Are there different types of
projections?
![Page 12: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/12.jpg)
Classical projections
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 13: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/13.jpg)
Parallel Projection
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 14: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/14.jpg)
Multiview orthographic
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 15: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/15.jpg)
Off-axis parallel
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 16: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/16.jpg)
View volume: Orthographic
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 17: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/17.jpg)
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 18: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/18.jpg)
Perspective projection (normal)
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 19: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/19.jpg)
View volume: Perspective
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 20: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/20.jpg)
Field of view
– Angle between the rays corresponding to
opposite edges of a perspective image
– Determines ‘strength’ of perspective effects
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 21: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/21.jpg)
CG 12/13 - T7
Adapted from Steve Marschner, Cornell University
![Page 22: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/22.jpg)
CG 12/13 - T7
Adapted from Steve Marschner, Cornell University
![Page 23: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/23.jpg)
3D Viewing
CG 12/13 - T7
![Page 24: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/24.jpg)
Pipeline of transformations
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 25: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/25.jpg)
CG 12/13 - T7
![Page 26: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/26.jpg)
Mathematics of projection
• Always works in eye coordinates
– Assume eye point is at 0 and plane
perpendicular to z
• Orthographic case
– Simple projection: Just discard z
• Perspective case: scale diminishes with z
– And increases with d
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 27: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/27.jpg)
Orthographic projection
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 28: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/28.jpg)
What about the view volume?
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 29: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/29.jpg)
Windowing transforms
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 30: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/30.jpg)
Viewport transformation
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 31: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/31.jpg)
Viewport transformation
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 32: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/32.jpg)
What about the z direction?
• Two clipping planes further constrain the
view volume
– Near plane: parallel to view plane; things
between it and the viewpoint will not be
rendered
– Far plane: also parallel; things behind it will
not be rendered
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 33: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/33.jpg)
Orthographic projection
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 34: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/34.jpg)
Orthographic projection matrix
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 35: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/35.jpg)
Viewing transformation
CG 12/13 - T7
Advanced topic: Refer to the text book if interested!
Adapted from Steve Marschner, Cornell University
![Page 36: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/36.jpg)
Orthographic transformation chain
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 37: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/37.jpg)
Perspective projection
CG 12/13 - T7
![Page 38: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/38.jpg)
View volume: Perspective (clipped)
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 39: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/39.jpg)
Perspective projection matrix
CG 12/13 - T7
Advanced topic: Refer to the text book if interested!
Adapted from Steve Marschner, Cornell University
![Page 40: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/40.jpg)
Perspective transformation chain
CG 12/13 - T7 Adapted from Steve Marschner, Cornell University
![Page 41: CG T7 - Projectionmcoimbra/lectures/CG_1213/CG_1213_T7_Projection.pdfMathematics of projection •Always works in eye coordinates –Assume eye point is at 0 and plane perpendicular](https://reader034.fdocuments.net/reader034/viewer/2022042123/5e9ec61bbcc35f47e95decf2/html5/thumbnails/41.jpg)
Summary
• Different types of projection
– Orthographic
– Perspective
• Integrate nicely into the transformation
chain
• Other elements:
– Viewing transform
– Viewport transform
CG 12/13 - T7