Results 1 to 13 of 13

Thread: Help me under BSP, compare to a QuadTree maybe?

  1. #1

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Help me under BSP, compare to a QuadTree maybe?

    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

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    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.

  3. #3
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    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.

    Irrlicht

    Phreak
    Last edited by «°°phReAk°°»; Apr 19th, 2005 at 02:01 AM.

    Visual Studio 6, Visual Studio.NET 2005, MASM

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    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.
    Attached Images Attached Images  
    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.

  5. #5

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    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

  6. #6
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    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.

    I suggest googling for more info.

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  7. #7
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755

    Re: Help me under BSP, compare to a QuadTree maybe?

    Quote 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.
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  8. #8
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    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.

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  9. #9

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    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

  10. #10
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755

    Re: Help me under BSP, compare to a QuadTree maybe?

    Quote 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...
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  11. #11
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755

    Re: Help me under BSP, compare to a QuadTree maybe?

    Quote Originally Posted by Halsafar
    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.
    Quake 1 Engine Source Code
    Other ID Software Source Codes
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  12. #12
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    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.

    I could use a link to the Source, source? (lol?)

    Ta,

    @Halsafar: Ta for Rating, and no problem

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  13. #13
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755

    Re: Help me under BSP, compare to a QuadTree maybe?

    Quote Originally Posted by «°°phReAk°°»
    I could use a link to the Source, source? (lol?)
    heh... Has that code been leaked/released?
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width