Skip to main content
gamedev.net
🔒 Locked

octree issue

Started by de_matt 0 replies 300+ views
Original Post
de_matt
de_matt
Hya, I''ve set up an octree. When I render the main initial cube it''s find. However, when I render an inner cube, the end corner polygon isn''t being included. I worked out that this is because of the way my terrains doen. It''s a grid-based logical terrain system. The problem is that although the final poly crosses the corner of the octree, none of the poly''s points lie within the octree area and thus it''s not included. Is this something to worry about or is it OK? (Will rendering using the viewing frustum make this irelevant? Thanx matt
extralongpants
extralongpants
I have delt with the same problem before. Here''s what I do:
When building the octree, test if the CENTER of the triangle is inside the node. When you finalize the node, resize it so that it contains all the points of all of its triangles. This method will work fine as long as you don''t have any gigantic triangles, in which case the octree node would be resized to an unacceptable level. Of course, you could test to see if the triangle''s size is greater than some threshold, in which case the triangle can be placed in this node''s parent. Well, anyway, I hope that helps. Good luck.

PS. This is similar to a method called ''loose-octrees.'' There''s an article about it in GAME PROGRAMMING GEMS

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.