Projection

Projection
Slide Note
Embed
Share

An overview of the Spring4D open source library for Delphi developers. Learn about its features, modules, getting started guide, future plans, and improvements. Explore how Spring4D enhances Delphi development with clean code and advanced features.

  • Delphi
  • Development
  • Spring4D
  • Open Source
  • Software

Uploaded on Mar 01, 2025 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Projection Part Two - Perspective Projection textbook 5.5-5.7

  2. Perspective Projection

  3. Frustrum Matrix A = (right+left)/(right-left) B = (top+bottom)/(top-bottom) C = -(far+near)/(far-near) D = -2*far*near/(far-near) E = 2 * near/(right-left) F = 2 * near/(top-bottom)

  4. Example 1 For example, if we set left = -1 right = 1 bottom = -1 top = 1 near = 1 far = 4 we get the matrix 1 0 0 0 0 1 0 0 0 0 -5/3 -8/3 0 0 -1 0

  5. Example 1 continued So the point A = [.5, .5, -1.5, 1] transforms to the point A' 1 0 0 0 .5 .5 0 1 0 0 * .5 = .5 0 0 -5/3 -8/3 -1.5 -.166 0 0 -1 0 1 1.5 to find the NDC of A, divide A' by w A'' = [.33, .33, -.111, 1]

  6. Example 1 continued So the point B = [.5, .5, -3.5, 1] transforms to the point B' 1 0 0 0 .5 .5 0 1 0 0 * .5 = .5 0 0 -5/3 -8/3 -3.5 3.166 0 0 -1 0 1 3.5 to find the NDC of B divide B' by w B'' = [.14, .14, .903, 1]

  7. Example 1 finally So A = [.5, .5, -1.5, 1] A'' = [.33, .33, -.111, 1] And B = [.5, .5, -3.5, 1] B'' = [.14, .14, .903, 1]

  8. Example 2 Let's push the box far away from the origin: left -2 right 2 bottom -2 top 2 near 20 far 25 We get the projection matrix: 10 0 0 0 0 10 0 0 0 0 -9 -200 0 0 -1 0

  9. Example 2A left right bottom -2 top near far -2 2 Our previous point: 2 20 25 P = [ .5, .5, -3.5, 1 ] P' = [ 5, 5, -231.5, -3.5 ] P'' = [ -1.4, -1.4, 66.1, 1 ]

  10. Example 2B left right bottom -2 top near far -2 2 P = P' = P'' = [ 1.5, [ 15, [ 0.71, 0.24, -0.52, 1 ] 0.5, 5, -21, -11, 1 ] 21 ] 2 20 25 P = P' = P'' = [ 1.5, [ 15, [ 0.63, 0.21, 0.67, 1 ] 0.5, 5, -24, 16, 1 ] 24 ]

  11. An Alternative Perspective projMatrix = perspective (fovy, aspect, near, far) fovy = field of view on Y axis, measured in degrees aspect = aspect ratio, usually 1 near, far = same as frustrum

More Related Content