1 / 69

Projection

Projection. Tong-Yee Lee. Readings. Computer Graphics Using OpenGL by F.S Hill, J.R. Chapter 7. Perspective ( 透視投影 ) v.s. Orthographic ( 正投影 ) projection. Multi-view Orthographic. Oblique parallel projection. Zs is lost , so it can not be used for Visible Surface Removal!!!.

ssimms
Download Presentation

Projection

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Projection Tong-Yee Lee

  2. Readings • Computer Graphics Using OpenGL by F.S Hill, J.R. • Chapter 7

  3. Perspective(透視投影)v.s. Orthographic (正投影) projection

  4. Multi-view Orthographic

  5. Oblique parallel projection

  6. Zs is lost , so it can not be used for Visible Surface Removal!!!

  7. d (dx, dy,dz,0) d=(0,0,1,0) Note that projection vector d (dx, dy,dz,0) is specified from -Z toward Z in the eye space coordinate

  8. What OpenGL wants is: • After projection, the image • space (after division) • become ……. • Left hand system • -1<=xs, ys, zs <=1 Regardless of parallel projection or perspective projection!!!

  9. Parallel Projection in OpenGL glortho(l,r,b,t,n,f) -Z -Z Translate and Scale d=(0,0,1,0) l (x’, 0) r -1 +1 +X +X

  10. Parallel Projection Matrix in OpenGL Image space in right hand system negate Z Image space in left hand system (OpenGL)

  11. This row will not affect the projection!!! Only affect the Zs value! And substitute the following to solve A and B

  12. Final Parallel Projection Matrix in OpenGL glOrtho(l,r,b,t,n,f) In parallel projection, w term also is 1.We do not need division!! Zs is good for Hidden Surface Removal !!! So, we want this model!! Zs is not lost Zs is lost

  13. What OpenGL wants is: • After projection, the image • space (after division) • become ……. • Left hand system • -1<=xs, ys, zs <=1 Regardless of parallel projection or perspective projection!!!

  14. Object is distorted in screen space but the projection result is still same!!

  15. (針孔成像模型)

  16. OR Zs is lost again!! Remember this!!

  17. (after division) In the image (screen) space coordinate (left hand system) In the eye space coordinate (right-hand system)

  18. Object is distorted in screen space but the projection result is still same!!

  19. -

  20. Resulting image on the near plane 3D NDC to 2D Image (Near) Plane Chapter 14

  21. fovxand fovy are assumed to be equal Note (1) X, Y, Z axis are named u,v,w in the following discussions!

  22. Note that the representation of point transform is different from the previous one in the following discussions: For example: Old New

  23. Good when we choose a canonical screen space volume or clipping volume Clipping Space Coordinate

  24. In clipping coordinate space, we perform clipping. We can therefore save division if points are outside the frustum of clipping coordinate space We will teach clipping soon!

  25. Something Interesting …Clipping What does it imply? Remember if a point is behind eye, we can not see it!!. i.e., w > 0, means it is behind eye. So, we can check the fourth item(before division). If the fourth item is negative, this point is behind the eye point.

  26. We neglect scales at X and Y first and we Will compute them latter

  27. the near plane (w = - n ) goes to the face w= -1of the image space cube , and the face defined by the far plane (w = - f ) goes to the face w = 1 of the image space cube. That’s (0,0,-n)P = (0,0,-1) (0,0,-f)P = (0,0,1) Note that in image space (after division)

  28. We want to map them to (0,0,-1) and (0,0,1) So,

  29. We should also note that (1) the above P has transformed any point to image space (left hand system (n=-1, f = 1)). So, as Zs is larger, it means it is far away from camera. (2) Point in image space will not lost its Zs component!! Zs is lost

  30. But, we want this term to be 1. So, after division, we get :

  31. Before we apply projection, we scale X, Y ………….. Scale can help ……….

More Related