Archived

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

implementations of octrees in DirectX

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

Guest Anonymous Poster
I thought this was DirectX but after I looked it up, It uses OpenGL...But I still think it''s a good example of Octrees.

http://www.ati.com/developer/sdk/rage128sdk/OpenGL/Demos/ATI_Terrain/ATI_Terrain.html

Share this post


Link to post
Share on other sites
i think gametutorials.com has an octree which is rendered using opengl.

an octree is just space partitioning, not much difference between opengl and direct3d except for the axis.

Share this post


Link to post
Share on other sites
jwalker: I''m aware, but directx uses all tha vertex buffer and index buffer stuff to render meshes. I asked for a DirectX example so I could see examples of how people manage vertex/index data.

Personally, I thought of keeping all of the vertices in a buffer in the main COctree class. Each CNode class will have an index buffer of all the triangles to be referenced. that way, I only have one call to setStreamSource per frame for my octrees.

That''s probably not the best approach, maybe not even a good one. I just wanted to see some other examples.

Share this post


Link to post
Share on other sites
try first by using DrawPrimitiveUP
since you will only be drawing a subset of the screen, i am sure it will be fast.

the problem with a vertex buffer is that you will need several calls to the buffer at different intervals.



Share this post


Link to post
Share on other sites
DrawPrimitiveUP uses a vertexbuffer aswell,
just that it locks and copies the vertices to
the buffer itself.
Use a dynamic vertexbuffer, lock it when you
start traversing the octree, and unlock it
when you''re done.


--
MFC is sorta like the swedish police... It''''s full of crap, and nothing can communicate with anything else.

Share this post


Link to post
Share on other sites