I am having a problem understanding the theory behind the basic BSP.
I understand QuadTree's just fine, but every explanation of BSP I've read completly confuse's me. So I am curious if anyone here can offer an explanation of a BSP Tree that is simple and lamen and possibly compare it to a QuadTree to ease in the explanation.
"From what was there, and was meant to be, but not of that was faded away." - - Steve Damm
"The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm
"When you do things right, people won't be sure if you did anything at all." - - God from Futurama
Re: Help me under BSP, compare to a QuadTree maybe?
Like the name says, every node in the binary tree just divide the space in two, one for each subnode. If you're working with a bunch of polygons, you could recursively take a polygon, divide the space so that all polygons that are in front of it are in the right node and the rest are in the left. If a polygon crosses that plane then you should split the polygon in two and put each side in resp node. Then go on splitting the childnodes recursively until there are only one polygon which will be a leaf node. A good idea would be to choose a polygon that splits about equal amount of polygon on each side.
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Re: Help me under BSP, compare to a QuadTree maybe?
This was helpful for me yonks ago when I read it. It might be worth a look. I might even read it again just to refresh.
Also, the Irrlicht 3D engine has the ability to read in BSP trees. So I would reccommend downloading it and checking that (I assume you're using C++?). Download the actual engine source, because theres a couple of different versions.
Re: Help me under BSP, compare to a QuadTree maybe?
btw here is an illustration of the partitioning of the space in the left, showing also how it is divided in the tree to the right.
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Re: Help me under BSP, compare to a QuadTree maybe?
Love the diagrams and love the links.
Thanks.
So, in a game when making a BSP tree, you should really only use a BSP tree for static object rights?
having a bsp tree for moving polygons would require a frame by frame update of the tree. Em I correct?
Since QUAD-TREE'S are the best for worlds, a BSP Tree should be great for the object in the world eh? like tree's, rocks, buildings, things that are stuck where they are, static object.
"From what was there, and was meant to be, but not of that was faded away." - - Steve Damm
"The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm
"When you do things right, people won't be sure if you did anything at all." - - God from Futurama
Re: Help me under BSP, compare to a QuadTree maybe?
Apparently, yes.
Counter-Strike: Source still uses BSP trees for its maps, although I'm not too sure how they accomplish what they do when everything in the world is interactive.
Re: Help me under BSP, compare to a QuadTree maybe?
Originally Posted by «°°phReAk°°»
Counter-Strike: Source still uses BSP trees for its maps, although I'm not too sure how they accomplish what they do when everything in the world is interactive.
Counter-Strike uses the Half-Life engine which is based upon the Quake 1 and 2 engines. So the BSP format that CS uses is really similar to the one Quake 1 uses.
The source for Quake is open, so you could easily check it out.
The TomazQuake mod has support for the CS format if you wanna know more about that.
Re: Help me under BSP, compare to a QuadTree maybe?
Actually, Counter-Strike: Source doesn't use the Half-life 1 Engine at all. Since Counter-Strike: Source is based on Half-Life 2, it too uses the Source engine created entirely by Valve.
Re: Help me under BSP, compare to a QuadTree maybe?
I don't see why everyone paniced over HL, I mean to me HL sucked compared to the current shooters at the time: GoldenEye 007 N64 and Perfect Dark. Quake 2 was even better in my mind. HL was just a nice looking Quake.
Now CounterStrike on the other hand was original and even though it was still HL it was a great mod, lots of fun, I could play that for hours.
But again, neither contained any marvel of programming.
Lets jump ahead to compare Battlefield 1942 and its mods with HL2 which came out not to long ago.
In my opinion, the guys who made BF1942 should be hailed for their extremely good programming abilities. HL2, looks like a nice BF1942 minus all the fun and extreme violence.
People just like say HL is good cause people like to say HL is good.
Anyway, I could use a link to the Q source codes, I had one once upon a time which had Doom, Wolfenstien and Quake source codes.
"From what was there, and was meant to be, but not of that was faded away." - - Steve Damm
"The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm
"When you do things right, people won't be sure if you did anything at all." - - God from Futurama
Re: Help me under BSP, compare to a QuadTree maybe?
Originally Posted by «°°phReAk°°»
Actually, Counter-Strike: Source doesn't use the Half-life 1 Engine at all. Since Counter-Strike: Source is based on Half-Life 2, it too uses the Source engine created entirely by Valve.
Phreak
Wrong. I've seen the source of the HL2 engine. It is still based upon Quake 1. Don't know about the BSP version though...
Re: Help me under BSP, compare to a QuadTree maybe?
I read somewhere what I said above. Might have been on a forum somewhere. I swear it was said that the built the Source Engine from scratch, IE: Blank Project. Meh, anyway. Let's not dwell.