Serious Noob BSP Help!!!


#1

I’m trying to program with DarkBASIC Pro, but am dead in the water with figuring out what BSP is and how to work it.

I have Lightwave 3d 8.

So if anyone can explain (in simple terms) what BSP is and how to use/create it, would be appreciated. Thanks.

I tried looking this up in search, but nothing came up. I apologize if this is a repeat question.

PS: I’ve already went to the DarkBASIC Forums and no one there knows anything. :stuck_out_tongue:


#2

First - it would be nice what you’re planning to do.
Second - BSP.

A BSP tree is used when you’re trying to implement a “painters algorithm”, meaning a way to draw objects from back to front. It can also be used for spacial subdivisons of a scene for accelerating object queries (like ray-object intersections), but is mostly considered too slow for real-time applications (except when it comes to pre-processed geometry like levels).

In fact - what yo do - is dividing the scene using the triangles/planar polygons included. That means you take each triangle/polygon and make it an infinite plane (better: infinite in it’s subspace-half - read on). This divides the space of your scene in two halfes, the one left (over) and the one right (below) your plane. Which one is over and which one is not is chosen using the normal vector of your plane (dot product is your friend).
You now create a binary tree of your scene using this left/right information.

The Problem with this technique is splitting. You will almost never find a plane that divides the space without hitting another triangle/polygon. In such a case you have to split the triangles intersecting the plane into two halves, so that each one lies perfectly left or right of your splitting plane.

The cool thing about this is, that you can easily decide what is behind a polygon (and thus maybe ocludded) and what is in front of a polygon (painters algorithm).
Doom (for instance) used this to become as fast as it was. I’m not sure if today’s games still use BSP creation for their levels as we now have the z-Buffer (which eliminates the need for a painters algorithm) and as collision detection, furstum culling, etc. can easily be done at similar speed with e.g. kD-trees (axis aligned BSPs), bounding volume hierarchies or similar data structures.

Hope that helps - whatever you’re planning to do.


#3

If your trying to create .BSP formated geometry you might want to check out level editing softwhere like Valves “hammer” or Quark or ones made for any version of Quake etc as these use .BSP for everything. Also maybe try Wildtangent and (a real oldy) Genesis 3D as these also work with .BSP as a base for there level geometry.

Even Unreal (all versions) still use .BSP brushes (geometry) as the foundations of all it’s levels which you then build up on using static mesh (hardware brushes) to add your detailing.

I thought DarkBasic came with a simple level editor for creating .BSP levels, maybe I was wrong. Lightwave and most other 3D apps do not in anyway export to .BSP without the use of custom exporters written for the specific version of .BSP required (eg: You cant usually use Quake exported .BSP in the unreal engine etc)

Hope that helps also.

K.


#4

Yeah, Thanks to both of you for your replys. You both gave some helpful hints so I can look for more on the internet about this.

I was planning to create a level where the player can move around and collide with the background, similar to Doom 3. From what I read, BSP handles collision within Darkbasic, except theres nothing written about how to create BSP levels (preferably from Lightwave if possible).

I do have Unreal 2004 (Unreal level editor 2003), but have no idea how to use it. I suppose I could surf their forums about how to do BSP.

Thanks again for the replies.


#5

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.