Sign in to follow this  

octree... what do I have to learn before I can implement an octree class

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

hi, I have heard about octree. IT's the way we can partition the space. But I don't know much about it. What I have to read before I can create my own octree. we can use octree for detecting collisions ? but how ? we partition the world at first time when games run ? so our world must be static object (a large mesh) ? First if we don't load objects into the world so how can we know their positions. I think we have to know object's position to assign it to octree ? or we have to create a complete world before we partition it ? and add how we can add dynamic objects to the world (if in my game I need a mouse which runs around the world) [smile] thanks for reading my questions... Because I'm a newbie so I ask many questions [smile]

Share this post


Link to post
Share on other sites
Time to do some research! I recommend:

1. Search gamedev for 'octree' and 'loose octree'.

2. Google for the same.

3. Check one of the first two GPG books (I can't remember which) for good articles on both basic octree construction and loose octrees.

4. Check the tutorials/developers sections on flipcode - I think there may be an octree tutorial there as well.

It's a well documented topic - you'll just have to do some work to dig up the details. A couple of hints, though. Octrees can handle static and dynamic objects. Objects can be referenced from multiple leaves, or you can use a 'loose' octree and have each object reside in one leaf only. The loose approach can lead to more tests, but insertion of dynamic objects is generally faster.

Good luck.

Share this post


Link to post
Share on other sites
okie

now I know the data structure used for octree.
but I have met a new trouble: how to assign mesh into nodes (end nodes).

I load a static mesh, then I have an index buffer and a vertex buffer, then I optimize the mesh(inplace).

I loop through the vertexbuffer to know the position of each vertex and where it should be put in. What can I do with the vertexbuffer? Should I create a vertexbuffer and an indexbuffer for each end node? or assign only index of vertex and index buffer to nodes.

thanks for your helps.

Share this post


Link to post
Share on other sites

This topic is 4780 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this