Jump to content
  • Advertisement
Sign in to follow this  
fatima

BSP Tree , how to create and render?

This topic is 3604 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

it's a long time I'm looking for a good start point about createing and rendering bsp trees , but all I have found is some papers about "what's bsp tree",any body can help me?I need some source code. sorry for my great english!

Share this post


Link to post
Share on other sites
Advertisement
I have implemented BSP trees for learning purpose.

First of all what type of rendering system you need ? BSP are best for rendering BACK to FRONT order. It helps to implement transparency. In my opinion BSP is not suited for large models.

Share this post


Link to post
Share on other sites
Quote:
Original post by kdworld
First of all what type of rendering system you need ? BSP are best for rendering BACK to FRONT order. It helps to implement transparency. In my opinion BSP is not suited for large models.


Or front to back for collision testing! ;)

If you need source (not the best way to learn IMO) then check out the quake 1 source.

The only remaining advantage of BSP style systems is that automatic portal + occlusion information can be generated due to the concept of solid space

Share this post


Link to post
Share on other sites
I need BSP Tree for collision detection.
is there a better way to fast rendering and collision detection in large scenes?

Share this post


Link to post
Share on other sites
I think for large screens , you can use octree or just AABBoxes(There are a number of data structures exists) .
By simple frustum culling can faster your rendering. IF your scene is really big you may need occlusion culling also. Implementing this will take some time.

What type of collision do you need ? Look SAT (separating axis theorm). I think SAT is fast method for checking intersection between triangles, triangle and boxes etc. Also if you don't want precise collision , use bounding volumes. It is easy and fast.

Share this post


Link to post
Share on other sites
yes,may be i have to learn octree.also using bounding box for intersection tests is nice.but another question : what about moving camera in our levels?
what kind of intersection test must be used?
I'm sorry for my super advanced questions.

Share this post


Link to post
Share on other sites
Quote:
Original post by fatima
I need BSP Tree for collision detection.
is there a better way to fast rendering and collision detection in large scenes?


BSP tree splitting is generally regarded as not worth while for collision. Generally speaking an axis aligned BSP tree (kdtree) is sufficient. You might want to consider two different spatial partions if you have a lot of moving objects, one for static geometry and one for moving. A dynamic sphere tree for moving objects seems to work quite well

Share this post


Link to post
Share on other sites
BSP-trees are not used that much anymore due to the fact that they operate on triangles and not on objects. Today is often better to just draw an object, rather than to spend time on determining what triangles are visible are what are not. Z-buffer makes back-2-front-rendering obsolete. Ordering draws front-2-back is better with Z-buffer since then most pixels are only rendered once.

For collision purposes I think that loose-octrees or octrees or any other structure than BSP-trees is the best! BSP-trees are hard to update when things move and it is hard to get rid of all numerical problems.

That said, I think BSP-trees are really cool, they just don't make that much sense nymore.

Share this post


Link to post
Share on other sites
I'm going to suggest a book.

http://realtimecollisiondetection.net/books/rtcd/

It deals with many structures that are needed in collision detection. It might be nice since it is written for people who wants to do collision detection (rather than say occlusion culling).

After reading the book you might decide to use Octree, BVH or something other. Perhaps you decide not to do it yourself and use a existing library instead.

There is also a list of all papers referenced from the book. If you don't want to borrow/buy it, perhaps you can find something in there!

http://realtimecollisiondetection.net/books/rtcd/references/index.html

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!