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?
BSP to Octree
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.
What ____ is (rather antagonistically) getting at, is that there is no need to have an editor that outputs octrees. You can just create the octree on-the-fly, as you load in the level geometry.
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?
Is there a engine or any thing that does this already that I can look at?
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.
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.
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.
But yeah, thats the whole idea.
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.
I would suggest going with .MAP files as they are fairly easy to load and manage.
But they do not store vertex data. You need to generate the vertices for each solid.
I just wrote a tutorial on how to do that here: http://lspiroengine.com/?p=400
L. Spiro
But they do not store vertex data. You need to generate the vertices for each solid.
I just wrote a tutorial on how to do that here: http://lspiroengine.com/?p=400
L. Spiro
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement