![]() |
Trying to implement BSP - any advice? (Solved) - Printable Version +- Wings 3D Development Forum (https://www.wings3d.com/forum) +-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1) +--- Forum: Programming (https://www.wings3d.com/forum/forumdisplay.php?fid=7) +--- Thread: Trying to implement BSP - any advice? (Solved) (/showthread.php?tid=922) |
Trying to implement BSP - any advice? (Solved) - nemyax - 10-29-2014 In an export plugin that I'm writing, I want to implement face slicing and sorting, based on a BSP tree. If I use the e3d mesh format, building a tree-like structure is easy enough: Code: bsp([H|T]) -> RE: Trying to implement BSP - any advice? - nemyax - 01-08-2015 I ended up with this: Code: walk([], Order, [], Data) -> % Data is {We,SplitPlaneNormal} It seems to flatten the "tree" just the way I need. RE: Trying to implement BSP - any advice? (Solved) - micheus - 01-08-2015 Thanks for sharing nemyax RE: Trying to implement BSP - any advice? (Solved) - nemyax - 01-12-2015 Turns out that this "in-place" sorting (which is in essence reverse pre-order traversal) produces adequate results only on very simple objects. I now create a linked structure instead: Code: branch_out(Fs, We) -> I still haven't found a suitable flattening principle though. |