Estruturas de Dados Espaciais: MC-930 MO-603
Estruturas de Dados Espaciais: MC-930 MO-603
MC-930
MO-603
Bounding Volumes
Grids
Data structure: a 3-D array of cells (voxels) that tile space
Each cell points to list of all surfaces intersecting that cell
Grids work well when you can arrange that each cell lists a few (ten,
say) objects
Better strategy for some scenes: nested grids
Octrees
1
2
3
2
3
a
1
b c
a BSP tree
using 2 as root
viewpoint
a
b
the subdivision
of space it implies
1
2a
2a
3
viewpoint
2b
2b
1
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}
}
1
2a
2a
3
viewpoint
2b
2b
1