• Advertisement

Archived

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

Octrees how to.... ???

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

Hello I am trying to implement a "simple" 3D engine. Currently i am using regular octrees (eight child of equal sizes)but I just pass to the renderer all the polys of nodes which intersect and inside the view frustum so my questions is as follows: ¿Is possible to use the Octree to render the polygons in a Front-To-Back order? By other hand I am trying to implement a code to order the polys inside Octree SECTORS to render only the which are facing to the camera, so maybe someone have tested it. My method is as follows: Build a regular Octree to partition the World in sectors of equal sizes. Then once the Octree is completed, I loop through all Octree SECTORS (nodes), and build a SOLID BSP tree for each sector that contain polys. Then to render it I use octree to perform SECTOR - VIEW FRUSTUM test and when I need render my SECTOR I loop through the BSP stored in that sector to render only those polys which are facing the camera. But to get this method rendered in a correct Front-to-back order I need traverse the Octree in FRONT-2-BACK order. Please tell me if someone have tryied to implement somthing like this? I really apprefciate any help about this, thx.

Share this post


Link to post
Share on other sites
Advertisement
Just a thought, but given the viewer/camera position, you could simply traverse each node in order of the distance from the viewer (i.e. distance between viewer pos and node centre, and using distance squared of course for greater speed). So for front-to-back render, just visit nodes in order smallest distance to largest distance (or do the opposite for a back-to-front render, useful for rendering translucent/blended surfaces). This should work fine as far as I can tell.

Hope that helped

[edit] AndersO posted while I was writing... the method shown on Harmless Algorithms looks much quicker, so disregard my drivel and use that

[edited by - Bad Monkey on May 31, 2002 3:14:24 AM]

Share this post


Link to post
Share on other sites
Thank you both for your replays. I guess i will try the Bad Monkey methodd, which seems easy to implement : )

Thanks for your help.

Regards!
Oscar

Share this post


Link to post
Share on other sites

  • Advertisement