• Advertisement

Archived

This topic is now archived and is closed to further replies.

Using Oct-Trees with .x Files?

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

Does anyone have any sites that contain information on how to make a oct tree with a .x file? I read about it some but I have''t been able to figure it out? I load the mesh and I know I must probably do something with its vertex buffer, and create an oct tree but I''ve been unable to find any information regarding using this with directx and .x files?

Share this post


Link to post
Share on other sites
Advertisement
.x or 3ds or any others file format is same thing: a bunch of triangles.

You must use Plane.ClassifyPolygon(Triangle) then, divide your scene in small boxes.

Share this post


Link to post
Share on other sites
If you just get the vertex & index buffers from the X mesh, and simply pull out all the triangles, you''re all set with your triangle soup and ready to make an octree. There shouldn''t be any problem with this.

-Mezz

Share this post


Link to post
Share on other sites
I don''t see where the problem is. You build a triangle list from the vertex / index buffers, loaded from a .x file or whatever, build your octree, and save the result to another format or a custom .x format (I dunno if you can do this though). Most often than not, the tree should just have indices to triangles/mesh fragments stored, and is completely detached from the actual geometry.

all that process should be done offline, as it is a bit expensive.

Share this post


Link to post
Share on other sites
quote:
You build a triangle list from the vertex / index buffers simply pull out all the triangles


Im not sure how to accomplish this part

Share this post


Link to post
Share on other sites

  • Advertisement