Using Oct-Trees with .x Files?

Started by
5 comments, last by DevLiquidKnight 20 years, 2 months ago
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?
Advertisement
Jim Adams does this in the book Programming Role-playing Games with Directx 8.0

It''s an excellent book.
.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.
wasnt really looking to buy a book >.<
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
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.

Everything is better with Metal.

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

This topic is closed to new replies.

Advertisement