Lecture19-BSP-trees

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

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

CS 455 – Computer Graphics BSP Trees

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

View Full Document
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.
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)

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

View Full Document
BSP Trees: Basic Idea + In the plane (= 0) Behind the plane (– side) eye t 2 t 1 In front of the plane (+ side)
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

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

View Full Document
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
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

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

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

## This note was uploaded on 03/02/2012 for the course C S 455 taught by Professor Jones,m during the Winter '08 term at BYU.

### 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
Ask a homework question - tutors are online