• Advertisement
Sign in to follow this  

BSP to Octree

This topic is 2071 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

I am trying to make a very simple engine and I love the idea of octrees they work in my head so I want to go with them altough I know they probably arnt the fastest for what im doing but I think its a great place to start.

The problem im running across is there doesnt seem to be a way to take a map out of an editor and save it as a octree?

Is there any way to convert maps of any type bsp, obj, map, 3ds whatever into a octree?

Share this post


Link to post
Share on other sites
Advertisement
How is that a stupid question more like that was a stupid answer. I have content already in bsp format I also dont know of an editor for octrees so thats what I am trying to figure out. I know that octrees and bsps are very different in the way data is stored and theres probably not a easy way to convert between them but there has to be something that can do it I dont care if it has to process for a week.

Share this post


Link to post
Share on other sites
So I could load up a bsp and create an octree from it on the fly? That would be cool but I have several issues I have no clue how that would even be done and that requires me to know more and Im just starting out and chose octrees for simplicity.

Is there a engine or any thing that does this already that I can look at?

Share this post


Link to post
Share on other sites
It should be very simple to create an octree, just start with a big box containing every polygon in your level, which is the root box.
Then you divide this box on the X, Y and Z axis so you have 8 new smaller boxes that fits inside the big box. Go through all the polygons in the big box and assign each one to the one of the 8 boxes that it is inside. It should be easy to check whether a polygon is inside a box.
Then you recurse and divide each of those 8 boxes into 8 smaller boxes, and assign each of the polygons in the parent box to one of the smaller boxes.

Then you have your octree. Edited by Erik Rufelt

Share this post


Link to post
Share on other sites

It should be very simple to create an octree, just start with a big box containing every polygon in your level, which is the root box.
Then you divide this box on the X, Y and Z axis so you have 8 new smaller boxes that fits inside the big box. Go through all the polygons in the big box and assign each one to the one of the 8 boxes that it is inside. It should be easy to check whether a polygon is inside a box.
Then you recurse and divide each of those 8 boxes into 8 smaller boxes, and assign each of the polygons in the parent box to one of the smaller boxes.

Then you have your octree.


Nice work man. You have put it down it such a simple way that it almost sounds like a school project.tongue.png
But yeah, thats the whole idea.

Share this post


Link to post
Share on other sites

It should be very simple to create an octree [...]

That's a pretty good basic explanation. You can also find a very basic tutorial here.

If this is still going over your head you might want to stick to something more basic for a little while first. smile.png

Share this post


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

  • Advertisement