Archived

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

mohotmoz

Octree Implementation

Recommended Posts

Hello, I understand that one way to see what things are visible and what things arn''t one can use an Octree, but I just don''t understand how. I am using the Octree sample at: http://www.flipcode.com/cgi-bin/msg.cgi?showThread=COTD-OctreeImplementation&forum=cotd&id=-1 Could someone briefly explain to me how one uses an Octree to do all the wonderful things people say they can do? (like polygon visibility) --Mohotmoz

Share this post


Link to post
Share on other sites
like polygon visibility

- take a node
- if it''s a node: look for all child if they are into the clipping planes
for each of they goto 1 with this node
- if it''s a leaf draw the faces thats are into

so the main of the cell are not render.

PS: I''m not a spécialist.

Why English rules?? C pas très malin tout ça!

Share this post


Link to post
Share on other sites
hi again,
To "check" visibility do I need to call transverse every frame and check for visibility within the transverse function?
Also, I am using .X files for this game is there a way to access some (if not all) of the verticies for input into the Octree creation?
--Mohotmoz

Share this post


Link to post
Share on other sites
My method was to implement octrees and a frustum class then i used the each little octree parts (cubes) and culled them using the frustrum culling technique of is the cuube in the frustrum or not.

Share this post


Link to post
Share on other sites
Yea, that''s basically what you can do, eh? I haven''t created an octree/quadtree myself yet, but I''m planning to soon. It really doesn''t seem too bad. I''d think it can be used for visiblity culling and also object collision culling. You can even use it to solve hidden surface removal for static objects at least. For visibility, I''d think you''d need you position, view direction and frustum information. You could do some checks to trivially accept or reject certain octants and recurse into borderline sectors for more accuracy in what sub-sectors really are within the frustum. I''m sure you could figure out a decent algorithm to do the culling. I know there some documented octree surface removal algorithm showing in what order you traverse the octree to draw everything to solve hidden surfaces... but I dunno how well that would work with dynamically moving objects; there is some things you could do, but I''m not sure how fast and accurate it would be.... I wish you luck!

Share this post


Link to post
Share on other sites