Skip to main content
GameDev.net gamedev.net
🔒 Locked

BSPs and octrees

Started by Korihor Oct 2, 2000 at 12:30 AM 7 replies 1.2k views
Original Post
Korihor
Korihor
Hey, I coded a program that loads shapes (spheres, triangles, whatever) from a file and displays them on the screen. Currently I am using a display list, but because I don''t want the objects to be static, I need to move them over to a BSP or an octree. Does anybody know of some good resources on BSPs and/or octrees, or can anybody help me figure them out? Thanks, Korihor
Authustian
Authustian
do a search for octree''s here or on flipcode, unfortunately i can only find explinations of how they work but not any code showing how they are implemented.

hope that helps, and if you find code post the addy here for me too

-------------------------------------------------
Don't take life too seriously, you''ll never get out of it alive. -Bugs Bunny
-------------------------------------------------Don't take life too seriously, you''ll never get out of it alive. -Bugs Bunny
wolfman8k
wolfman8k
I think you are mistaken. BSP trees(and I think octrees) can only hold static data. Only the camera can move around them. They are usually used for levels(BSPS) and terrain(octrees). If you want totaly dynamic data you''ll have to just stick to zbuffering.

If you still are interested in BSP''s here an exellent tutorial with source.

http://www.tasteofhoney.freeserve.co.uk/vsd/bsp/bsppart1.html

The source is direct x. But you can port it to gl.
richardve
richardve
quote:
Original post by wolfman8k

I think you are mistaken. BSP trees(and I think octrees) can only hold static data. Only the camera can move around them. They are usually used for levels(BSPS) and terrain(octrees). If you want totaly dynamic data you''ll have to just stick to zbuffering.



I think you are mistaken now Octrees can hold dynamic data (and objects too) but you have to modify the algorithm to do the trick.

Octrees are NOT for terrains, if you want to make a terrain then you should make a Quadtree (with nice things like ROAM)


Korihor:

If you want an example for building an octree you can go to FlipCode and search in the Code Of The Day section.
wolfman8k
wolfman8k
Sorry for the mistake. I''m not a big expert in octrees. Actually, I''ve never used them before. Just heard about them.
Korihor
Korihor
Can you give me an example or point me where to go on how to make an octree hold dynamic shapes?
richardve
richardve
Sorry, I can''t give you an example but it isn''t very hard to code.

TIP: You should first know how to build a static octree, how to traverse the tree and so on.

For more info read the tutorial about Octrees (static) @ GL velocity

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.