1 / 10

Details of gluLookAt (eye, center, up)

- f. s. Details of gluLookAt (eye, center, up). Change of Basis (after the translation to eye ). L. L T. Equivalent to:. Modelview Matrix. Viewing Transform. Model Transform. world coordinates. OpenGL Pipeline. R 4. R 4. R 4. [-1,1] 3. R 4. Projection in OpenGL.

blythe
Download Presentation

Details of gluLookAt (eye, center, up)

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. -f s Details of gluLookAt (eye, center, up) Change of Basis (after the translation to eye) L LT Equivalent to:

  2. Modelview Matrix Viewing Transform Model Transform world coordinates OpenGL Pipeline R4 R4 R4 [-1,1]3 R4

  3. Projection in OpenGL • Different from those we just discussed (R4R3) • Setting up a viewing frustum (in eye coordinates), establish a mapping to NDC [-1,1]3 • The desired behavior is set by R-1; find its inverse as the projection matrix R • Frustum is in left-hand coordinate system • Clip coordinate is in right-hand coordinate system • The Z-values in clip coordinate are depth buffer values [shift to [0,1]?!] • Reference (this is helpful)

  4. y z x near,far: can be +/- near,far: negative if behind the viewer (specified in a left hand coordinate) glOrtho (l,r,b,t,n,f) , eye coord. NDC. (1,1,-1) (-1,-1,1) Say, near = -10 (behind viewer), zeye = 10, zNDC = -1 far = 20 (in front of viewer), zeye = -20, zNDC = 1

  5. Check:

  6. y z x rf/n f r n n,f must be positive n cannot be zero glFrustum (l,r,b,t,n,f) (1,1,1) eye coord. NDC. (-1,-1,-1)

  7. Check: eye coord. NDC.

  8. From glFrustum Set h/2 n fovy n,f must be positive n cannot be zero gluPerspective (fovy, aspect, n,f)

  9. Depth Buffer Precision (ref) • Depth buffer precision is affected by the values specified for zNear and zFar. • The greater the ratio of zFar to zNear is, the less effective the depth buffer will be at distinguishing between surfaces that are near each other. • If r =zFar/zNear, roughly log2r bits of depth buffer precision are lost. • Because r approaches infinity as zNear approaches 0, zNear must never be set to 0. Depth precision error Ze: z_eye Zn: z_NDC

  10. Verification • V: viewpoint (gluLookAt) • N: viewplane (the near plane) equation • Project OFF letter model • compare your result with OpenGL result.

More Related