1 / 40

Viewing Transformation and Back-face culling

Viewing Transformation and Back-face culling. Tong-Yee Lee. OpenGL Graphics Pipeline. From world coordinate to eye coordinate. Note: eye is defined at world coordinate. Note: visible object’s Z is negative. Front and Back Clipping Planes. Frustum

Download Presentation

Viewing Transformation and Back-face culling

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. Viewing Transformationand Back-face culling Tong-Yee Lee

  2. OpenGL Graphics Pipeline

  3. From world coordinate to eye coordinate Note: eye is defined at world coordinate Note: visible object’s Z is negative

  4. Front and Back Clipping Planes • Frustum • Volume of space between front and back clipping planes • What camera can see – what drawn on screen • Near and far clipping planes defined by distance along Look Vector • Objects appearing outside of view volume don't get drawn • Objects intersecting view volume get clipped

  5. OpenGL: Field of View, gluPerspectiveYet another way to set viewing front plane aspect = w/h • Can always use: glFrustum(left, right, bottom, top, near, far) • This is certainly sufficient • But may be inconvenient in some applications • Can be difficult to get desired view • May want to use: gluPerspective(fovy, aspect, near, far) • specifies field of view along y axis • angle θ made by the sides of frustum • aspect ratio of viewport • just (width / height)

  6. World coordinate v.s. eye coordinate

  7. Eye-coordinate to Clip coordinate

  8. Back-face culling (trivial rejection) One method of implementing back-face culling is by discarding all triangles where the dot product of their surface normal and the camera-to-triangle vector is greater than or equal to zero where P is the view point, V0 is the first vertex of a triangle and N is its normal, defined as a cross product of two vectors representing sides of the triangle adjacent to V0 Reject condition N V2 P V1 V0

  9. Back-face culling (trivial rejection), i.e., almost cull-off 50%

  10. Ans: set up camera orientation

  11. Intuitive Camera Specification

  12. X axis vector Y axis vector Z axis vector

  13. Intuitive Camera Specification

  14. Not easy for user to pick up exact up vector!! So, we compute v automatically from up vector.

  15. Note that matrix storage order is column major in OpenGL

  16. 俯仰 偏航 翻滾 u (i.e., x) axis n (i.e.,z) axis v (i.e., y) axis Treat yourself (viewer) as a airplane heading to –Zc Note that: as a viewer is moving, the object is moving in opposite direction on the viewing plane!!

  17. This is z-like rotation

  18. How about slide() • Sliding a camera means to move it along one of its own axes-that is in the u,v,n direction-without rotating it. • Along n means forward or backward • Along u is left and right • Along v is up and down • Assume slide(delU, delV, delN) 延camera座標軸 walking

  19. Flythrough a Scene!!! ‘P’-64 =ctrl+‘P’ Homework #2 (optional) Add this camera control!!

  20. Light v.s. Eye coordinate Camera Frame

  21. Motion Overview of Human Actions http://graphics.csie.ncku.edu.tw/Motion_Overview/ Same v.s. Different camera paths for different motions

  22. v’ n’ n u n’ u’ v n This is x-like rotation (pitch) This is y-like rotation (yaw)

More Related