How to create a BSP tree?

Started by
16 comments, last by owiley 15 years, 2 months ago
A BSP tree is just like an octree but with 2 child nodes per node instead of more child nodes per node?
Advertisement
even though its old its still very useful but getting it right takes a bit of know how. Before going off and implementing the bsp tree go and research data structures i general. See what it is that make them so useful from there ask your self what do i really want it to do and which architecture is best suited for my application.

Bsp tree is a tree like data structure. Like all tree structure they connect data in a tree like manner through the use of nodes. In graphics this can be done dividing the scene up. This is where bsp is mainly used but it has many usages. it can orgranize a scene and do much more. look at wiki for more detail around bsp and look at papers for implementations of such datastructures
Bring more Pain
kd-trees are a subset of BSP trees that are very good for doing efficient raytracing. You might want to do raytracing for a number of reasons.

a) you may be using raytraced rendering
b) you may be generating ambient occlusion maps
c) you may be shooting bullets or lasers
d) you may be trying to have one object follow along the surface of another object, requiring you to shoot rays at the object and find where they intersect (ie, for walking on a mountainous surface)

There are, of course, many other possible scenarios.

I haven't focused much on collision stuff, so I am not totally sure what is best to use for that. I do know that you typically form geometrically simplified versions of your models, and then may nest those in AABB's and such. You probably wouldn't use a BSP tree for object-object collision detection.
Then how would I do efficient and fast collision detection? With the world AND other moving objects?
this all depends but with bsp you check all the near node of the scene to the cam
Bring more Pain
point is that you dont want to check everything because that would be pointless and slow think of how you are partioning the scene and find whats near you and check them
Bring more Pain
I know what its point is. I wanna know which way is the fastest and how exactly it works.
theres is a trade off in getting in fast but im sure you know that. Google quick collision response it should show up something. Maybe bounding sphere where you check the location in a certain range which is the radius.
Bring more Pain

This topic is closed to new replies.

Advertisement