#1 Members - Reputation: 350
Posted 18 May 2012 - 11:06 AM
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?
#2 Members - Reputation: 18
Posted 20 May 2012 - 12:24 AM
https://sites.google.com/site/imoomohomozumo/
#3 Members - Reputation: 350
Posted 20 May 2012 - 12:43 AM
#4 Senior Moderators - Reputation: 4749
Posted 20 May 2012 - 08:09 AM
Tristam MacDonald - SDE @ Amazon - swiftcoding [Need to sync your files via the cloud? | Need affordable web hosting?]
#5 Members - Reputation: 350
Posted 20 May 2012 - 08:20 AM
Is there a engine or any thing that does this already that I can look at?
#6 Members - Reputation: 1988
Posted 20 May 2012 - 10:56 AM
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, 20 May 2012 - 10:57 AM.
#7 Members - Reputation: 316
Posted 20 May 2012 - 10:16 PM
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.
#8 Staff - Reputation: 8926
Posted 20 May 2012 - 11:55 PM
That's a pretty good basic explanation. You can also find a very basic tutorial here.It should be very simple to create an octree [...]
If this is still going over your head you might want to stick to something more basic for a little while first.
- Jason Astle-Adams.
From my blog: 20 ways to advertise your game | What next? Intermediate to advanced C++
How to make games WITHOUT programming | 4 reasons you aren't a successful indie developer
#9 Crossbones+ - Reputation: 5186
Posted 21 May 2012 - 05:23 AM
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
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums






