Presentation is loading. Please wait.

Presentation is loading. Please wait.

Transformation Back-face culling View frustum culling

Similar presentations


Presentation on theme: "Transformation Back-face culling View frustum culling"— Presentation transcript:

1 Transformation Back-face culling View frustum culling
Assignment 2 Phase 1 Transformation Back-face culling View frustum culling

2 Outline Implement the transformation. Implement back-face culling.
Viewing transformation Projection transformation Perspective division Viewport transformaion Implement back-face culling. Implement view frustum culling.

3 Input and Output Input: *.view *.obj *.mtl
Same as assignment 1 Output: Wireframe of the obj with back-face culling

4 Transformation 1/3 Viewing transformaion Tview = B T
Modelview Matrix Projection Matrix Viewport Transformation Perspective Division Vertex Viewing transformaion Tview = B T Implement gluLookat() in OpenGL

5 Transformation 2/3 Projection transformation Tp = NSH
Implement gluPerspective() in OpenGL, so do not need to implement H

6 Transformation 3/3 Perspective division Viewport transformation
All X,Y,Z,W are divided by W. Viewport transformation Tv = T S

7 Back-face culling You can perform back-face culling in World cord.
View cord. ZN < 0 Window cord. Clock wise 1 Back face 3 2

8 View frustum culling eliminate the polygon that complete outside the view frustum. Bonus: view frustum clipping Remove the part of polygon that outside the view frustum.

9 How to draw wireframe? Render the image using glBegin(GL_LINE_LOOP);
glVertex2i(x,y); glEnd();

10 What to do in reshape function?
void GL_reshape(GLsizei w, GLsizei h){ glViewport(viewport->x, viewport->y, viewport->width, viewport->height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(viewport->x, viewport->width, viewport->y, viewport->height); glMatrixMode(GL_MODELVIEW); }

11 UI requirement Show an input command line.
“Please input the file name.” If I type “box”, then read box.obj and box.view etc.


Download ppt "Transformation Back-face culling View frustum culling"

Similar presentations


Ads by Google