20
Estruturas de Dados Espaciais MC-930 MO-603

Spatial

Embed Size (px)

DESCRIPTION

computação grática

Citation preview

  • Estruturas de Dados EspaciaisMC-930MO-603

  • Speeding Up Ray Tracing

  • Estruturas de Dados Espaciais

  • Bounding Volumes

  • Hierarquical Bounding Volume

  • GridsData structure: a 3-D array of cells (voxels) that tile spaceEach cell points to list of all surfaces intersecting that cell

  • Mais sobre GridsBe Careful! The fact that a ray passes through a cell and hits na object doesnt mean the ray hit that object in that cellOptimization: cache intersection point and ray id in mailbox associated with each objectGrids are a poor choice when the world is nonhomogeneous (clumpy)e.g. a teapot in a stadium: many polygons clustered in a small spaceHow many cells to use?too few many objects per cell slowtoo many many empty cells to step through slowGrids work well when you can arrange that each cell lists a few (ten, say) objectsBetter strategy for some scenes: nested grids

  • Octrees

  • Which Structure is Best for Ray Tracing?

  • K-d Trees and BSP Trees

  • Building a BSP Treethe subdivisionof space it impliesa BSP treeusing 2 as root231123abcdabcdviewpoint

  • Building the Tree 212a2b332a2b1viewpointUsing line 3 for the root requires a split

  • Building a Good Tree - the tricky part

  • Uses for Binary Space Partitioning (BSP) Trees

  • Painters Algorithm with BSP trees

  • Drawing a BSP Tree front_to_back(tree, viewpt) { if (tree == null) return; if (positive_side_of(root(tree), viewpt)) { front_to_back(positive_branch(tree, viewpt); display_polygon(root(tree)); front_to_back(negative_branch(tree, viewpt); } else { draw negative branch first} }

  • Drawing Back to Front12a2b332a2b1viewpointHidden surface removal

  • Clipping BSP Trees

  • Clipping BSP Trees

  • Clipping Using Spatial Data Structures