Lecture19-BSP-trees

Lecture19-BSP-trees - CS 455 Computer Graphics BSP Trees...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 455 – Computer Graphics BSP Trees
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Objectives Learn how to build and read BSP Trees Know how to use BSP trees in several applications Hidden surface removal Figuring out where the camera is. Collision detection Has applications in optimized ray tracers as well as optimized collision detection.
Background image of page 2
Binary Space Partition (BSP) Tree Recursively subdivide space to determine depth order: Think of scene as clusters of objects Find a plane that separates two clusters Recursively subdivide clusters by finding appropriate planes Store subdivision (space-partioning) planes in a binary tree - Node: stores a polygon and a space partioning plane - Left child: subtree of objects on negative side of plane - Right child: subtree of objects on positive side of plane Very efficient for static scenes Handy for intersections (and handy for occlusion)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
BSP Trees: Basic Idea + In the plane (= 0) Behind the plane (– side) eye t 2 t 1 In front of the plane (+ side)
Background image of page 4
BSP Trees: Basic Idea + In the plane (= 0) Behind the plane (– side) eye t 2 t 1 In front of the plane (+ side) The cluster on the same side of the plane as the viewpoint can obscure, but cannot be obscured by, the cluster on the other side of plane
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
BSP Algorithm BSP Tree: partitions space into positive and negative sides Node: polygon and a space partioning plane Left child: subtree of objects on negative side of plane Right child : subtree of objects on the positive side of plane. 1 2 3 Root polygon + 4 + eye
Background image of page 6
BSP Drawaing Algorithm 1 2 3 Root polygon + 4 + eye draw( tree , eye ) { if ( tree .empty()) then return; if ( tree . f plane ( eye ) < 0) then draw( tree .plus, eye ); rasterize( tree .triangle); draw( tree .minus, eye ) else draw( tree .minus, eye ); rasterize( tree .triangle); draw( tree .plus, eye ); } 1 3 2 + 4 + Resulting drawing order: 2, 4, 1, 3
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
BSP Tree Creation Algorithm 1. Select a polygon and make it the root 2. Partition space into two half-spaces determined by
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 37

Lecture19-BSP-trees - CS 455 Computer Graphics BSP Trees...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online