Jump to content

  • Log In with Google      Sign In   
  • Create Account


BSP to Octree


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 jeff8j   Members   -  Reputation: 724

Like
0Likes
Like

Posted 18 May 2012 - 11:06 AM

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?

Firefox youtube video and audio downloader MP3 MP4 OGG WEBM

https://addons.mozilla.org/en-US/firefox/addon/simple-youtube-converter/


Sponsor:

#2 WiredCat   Members   -  Reputation: 236

Like
-8Likes
Like

Posted 20 May 2012 - 12:24 AM

stupid question, just load map and create an octree

#3 jeff8j   Members   -  Reputation: 724

Like
0Likes
Like

Posted 20 May 2012 - 12:43 AM

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.

Firefox youtube video and audio downloader MP3 MP4 OGG WEBM

https://addons.mozilla.org/en-US/firefox/addon/simple-youtube-converter/


#4 swiftcoder   Senior Moderators   -  Reputation: 9846

Like
1Likes
Like

Posted 20 May 2012 - 08:09 AM

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.

Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]


#5 jeff8j   Members   -  Reputation: 724

Like
0Likes
Like

Posted 20 May 2012 - 08:20 AM

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?

Firefox youtube video and audio downloader MP3 MP4 OGG WEBM

https://addons.mozilla.org/en-US/firefox/addon/simple-youtube-converter/


#6 Erik Rufelt   Crossbones+   -  Reputation: 3270

Like
0Likes
Like

Posted 20 May 2012 - 10:56 AM

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, 20 May 2012 - 10:57 AM.


#7 Marvel Magnum   Members   -  Reputation: 324

Like
0Likes
Like

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.Posted Image
But yeah, thats the whole idea.

#8 jbadams   Senior Staff   -  Reputation: 17932

Like
0Likes
Like

Posted 20 May 2012 - 11:55 PM

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. Posted Image

#9 L. Spiro   Crossbones+   -  Reputation: 13193

Like
0Likes
Like

Posted 21 May 2012 - 05:23 AM

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
It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
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
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS