1 Binary Space Partition Trees ©Anthony Steed, Yiorgos Chrysanthou 1999-2003.

Slides:



Advertisements
Similar presentations
Visible-Surface Detection(identification)
Advertisements

Dynamic Programming Introduction Prof. Muhammad Saeed.
Clipping Covers chapter 10 of Computer Graphics and Virtual Environments (Slater, Steed and Chrysanthou) . See ©Yiorgos Chrysanthou.
GR2 Advanced Computer Graphics AGR
Linked Lists.
CS Data Structures Chapter 4 Lists. Chain (1/3) Chain: Chain: A singly linked list in which the last node has a null link A singly linked list in.
Chapter 12 Binary Search Trees
Binary Search Tree Smt Genap
Collisions and Intersections When objects move, test for collision. When projecting surfaces, check for intersections. (Many slides adapted from Amitabh.

AVL Trees1 Part-F2 AVL Trees v z. AVL Trees2 AVL Tree Definition (§ 9.2) AVL trees are balanced. An AVL Tree is a binary search tree such that.
03/12/02 (c) 2002 University of Wisconsin, CS559 Last Time Some Visibility (Hidden Surface Removal) algorithms –Painter’s Draw in some order Things drawn.
Hidden Surface Removal Why make the effort?  Realistic models.  Wasted time drawing. OpenGL and HSR  OpenGL does handle HSR using the depth buffer.
CSE 381 – Advanced Game Programming Scene Management
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
Outline Scapegoat Trees ( O(log n) amortized time)
BSP Trees Binary space partitioning trees. Used to store a collection of objects in n- dimensional space. Tree recursively divides n-dimensional space.
© 2004 Goodrich, Tamassia QuickSort1 Quick-Sort     29  9.
Introduction General Data Structures - Arrays, Linked Lists - Stacks & Queues - Hash Tables & Binary Search Trees - Graphs Spatial Data Structures -Why.
A lion in the desert How do you find a lion in the desert? How about when you have a predicate that tells you if the lion is in front or behind a separating.
A lion in the desert How do you find a lion in the desert? How about when you have a predicate that tells you if the lion is in front or behind a separating.
1 Advanced Scene Management System. 2 A tree-based or graph-based representation is good for 3D data management A tree-based or graph-based representation.
Estruturas de Dados Espaciais MC-930 MO-603. Speeding Up Ray Tracing.
10/11/2001CS 638, Fall 2001 Today Kd-trees BSP Trees.
10/02/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Octrees.
Hidden Surface Removal
Spatial Data Structures Jason Goffeney, 4/26/2006 from Real Time Rendering.
The BSP-tree from Prof. Seth MIT.. Motivation for BSP Trees: The Visibility Problem We have a set of objects (either 2d or 3d) in space. We have.
Binary Trees 2 Overview Trees. Terminology. Traversal of Binary Trees. Expression Trees. Binary Search Trees.
Data Structures Balanced Trees 1CSCI Outline  Balanced Search Trees 2-3 Trees Trees Red-Black Trees 2CSCI 3110.
PRESENTED BY – GAURANGI TILAK SHASHANK AGARWAL Collision Detection.
Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy Walters, and Godfrey Muganda Modified for use at Midwestern State University Chapter.
Where We Stand At this point we know how to: –Convert points from local to window coordinates –Clip polygons and lines to the view volume –Determine which.
Maths & Technologies for Games Spatial Partitioning 2
Presented by: Bhavna Agarwal. Given a bunch of 3D objects predefined in x,y,z; order them in geometry.
Copyright © 2012 Pearson Education, Inc. Chapter 20: Binary Trees.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
01/28/09Dinesh Manocha, COMP770 Visibility Computations Visible Surface Determination Visibility Culling.
TREES Lecture 11 CS2110 – Spring Readings and Homework  Textbook, Chapter 23, 24  Homework: A thought problem (draw pictures!)  Suppose you use.
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
Course: Programming II - Abstract Data Types HeapsSlide Number 1 The ADT Heap So far we have seen the following sorting types : 1) Linked List sort by.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 20: Binary Trees.
Visibility Determination – List Priority Methods Chapter 11.
Hidden Surface Removal. 2 Goal: Determine which surfaces are visible and which are not. Z-Buffer is just one of many hidden surface removal algorithms.
Merge Sort 1/12/2018 5:48 AM Merge Sort 7 2   7  2  2 7

CSE373: Data Structures & Algorithms
Top 50 Data Structures Interview Questions
Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008
CISC220 Fall 2009 James Atlas Lecture 13: Binary Trees.
BSP Trees Binary space partitioning trees.
Binary Search Trees.
Quick-Sort 9/12/2018 3:26 PM Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia,
Chapter 20: Binary Trees.
Data Structures and Database Applications Binary Trees in C#
Description Given a linear collection of items x1, x2, x3,….,xn
CSCE 441: Computer Graphics Hidden Surface Removal
Data Structures Balanced Trees CSCI
Chapter 21: Binary Trees.
Trees Lecture 9 CS2110 – Fall 2009.
Trees & Forests D. J. Foreman.
Forests D. J. Foreman.
Lecture 32: Visible Surface Detection
Quick-Sort 2/25/2019 2:22 AM Quick-Sort     2
slides created by Alyssa Harding
Quick-Sort 4/8/ :20 AM Quick-Sort     2 9  9
Quick-Sort 4/25/2019 8:10 AM Quick-Sort     2
Lecture 31: Visible Surface Detection
Trees Lecture 10 CS2110 – Spring 2013.
Presentation transcript:

1 Binary Space Partition Trees ©Anthony Steed, Yiorgos Chrysanthou

2 Overview n Previous list priority algorithms fail in a number of cases non of them is completely general n BSP tree is a general solution, but with its own problems Tree size Tree accuracy

3 Binary Space Partitioning Trees (Fuchs, Kedem and Naylor `80) n More general, can deal with inseparable objects n Automatic, uses as partitions planes defined by the scene polygons n Method has two steps: building of the tree independently of viewpoint traversing the tree from a given viewpoint to get visibility ordering

4 Building a BSP Tree (Recursive) A set of polygons {1, 2, 3, 4, 5, 6} The tree

5 Building a BSP Tree (Recursive) Select one polygon and partition the space and the polygons

6 Building a BSP Tree (Recursive) Recursively partition each sub-tree until all polygons are used up

7 Building a BSP Tree (Recursive) n Start with a set of polygons and an empty tree n Select one of them and make it the root of the tree n Use its plane to divide the rest of the polygons in 3 sets: front, back, coplanar. Any polygon crossing the plane is split n Repeat the process recursively with the front and back sets, creating the front and back subtrees respectively

8 Building a BSP Tree (Incremental) n The tree can also be built incrementally: start with a set of polygons and an empty tree insert the polygons into the tree one at a time insertion of a polygon is done by comparing it against the plane at each node and propagating it to the right side, splitting if necessary when the polygon reaches an empty cell, make a node with its supporting plane

9 Back-to-Front Traversal void traverse_btf(Tree *t, Point vp) { if (t = NULL) return; endif if (vp in-front of plane at root of t) traverse_btf(t->back, vp); draw polygons on node of t; traverse_btf;(t->front, vp); else traverse_btf(t->front, vp); draw polygons on node of t; traverse_btf(t->back, vp); endif }

10 BSP as a Hierarchy of Spaces n Each node corresponds to a region of space the root is the whole of R n the leaves are homogeneous regions

11 Representation of Polygons

12 Representation of Polyhedra

13 BSP Trees for Dynamic Scenes n When an object moves the planes that represent it must be removed and re-inserted n Some systems only insert static geometry into the BSP tree n Otherwise must deal with merging and fixing the BSP cells (see the book!)

14 Recap n A BSP is a sequence of binary partitions of space n Can be built recursively or incrementally n Choice of plane used to split is critical n BSP trees are hard to maintain for dynamic scenes