CSC418 Computer Graphics - PowerPoint PPT Presentation

About This Presentation
Title:

CSC418 Computer Graphics

Description:

average the face normals. Bilinear Interpolation. Puv = (1-u)(1-v)P0 ( u )(1-v)P1 ... Examples: painters algorithm, BSP. O(n2 ) CSC418 Computer Graphics. Next ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 26
Provided by: Karan4
Category:

less

Transcript and Presenter's Notes

Title: CSC418 Computer Graphics


1
CSC418 Computer Graphics
  • Polygon normals
  • Back Faces
  • Visibility Algorithms

2
Polygon Normal
  • Triangle normal calculation
  • Polygon normal calculation
  • Polymeshes (vertex normals)

3
Polygon Normal
  • Triangle normal calculation
  • N(P2-P1)X(P3-P2)

P1
P3
P2
4
Polygon Normal
  • Polygon normal calculation
  • N(P2-P1)X(P3-P2)

Pn
P1
P5
P4
P3
P2
5
Polygon Normal
  • Polygon normal calculation
  • N(P2-P1)X(P3-P2)
  • Problems
  • Sliver triangles
  • Non-planar polygons

Pn
P1
P5
P4
P3
P2
6
Polygon Normal
  • Polygon normal calculation
  • Nx S (yj yi)(zj zi)
  • Ny S (zj zi)(xj xi)
  • Nz S (xj xi)(yj yi)
  • j (i1) mod n

Pn
P1
P5
P4
P3
P2
7
Polymesh Normal
  • Face normals

8
Polymesh Normal
  • Vertex normals

9
Polymesh Normal
  • Vertex normals
  • average the face normals

10
Bilinear Interpolation
  • Puv (1-u)(1-v)P0
  • ( u )(1-v)P1
  • ( u )( v )P2
  • (1-u)( v )P3

P3
P2
Puv
v
P0
u
P1
11
Bilinear Interpolation
  • Puv (1-u)(1-v)P0
  • ( u )(1-v)P1
  • ( u )( v )P2
  • (1-u)( v )P3

Gourard shading (color interpolation)
P3
P2
Puv
v
P0
u
P1
12
Visibility Problem
  • What is NOT visible?

13
Visibility Problem
  • What is NOT visible?
  • primitives outside of the field of view
  • back-facing primitives
  • primitives occluded by other objects closer to
    the camera

14
Backface culling
15
Backface culling
16
Backface culling
N
V
E
17
Backface culling
  • N.V gt 0 is a back face?

18
Backface culling
  • N.(P-E) gt0

P
N
V
E
19
Backface culling
  • Where in the graphics pipeline can we do backface
    culling?

20
Occluded faces
  • Does backface culling always determine visibility
    completely for a single object?

21
Occluded faces
  • In typical scenes some polygons will overlap, we
    must determine which portion of each polygon is
    visible to eye!

22
Painters Algorithm
  • Sort primitives in Z.
  • Draw primitives back to front (CBA).

B
C
A
23
Painters Algorithm
  • Problems
  • Large faces
  • Intersecting faces
  • Cycles

24
Visibility Problem
  • Image space algorithms
  • Operate in display terms pixels, scanlines
  • Visibility resolved to display resolution
  • Examples Z-buffer, ray-tracing
  • O(nresolution)
  • Object Space algorithms
  • Analytically compute visible fragments
  • Examples painters algorithm, BSP
  • O(n2 )

25
CSC418 Computer Graphics
  • Next Lecture
  • BSP trees
  • Depth sorting
  • Z-buffer A-buffer
Write a Comment
User Comments (0)
About PowerShow.com