• Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Social Media
    •   @Wings3dOfficial
    •   @Wings3dOfficial
    •   Wings3dOfficial
    •   Wings3dOfficial
  • Register
  • Login
  • Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Register
  • Login
Wings 3D Development Forum Wings 3D Programming v
« Previous 1 2 3 4 Next »
Trying to implement BSP - any advice? (Solved)

 
  • 0 Vote(s) - 0 Average
Trying to implement BSP - any advice? (Solved)

nemyax
Offline

Member

Posts: 128
Threads: 14
Joined: Nov 2012
#4
01-12-2015, 10:07 PM
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) ->
    {_,A,We0} = distribute(Fs, We),
    branch_out(orddict:new(), [A], We0).
branch_out(Lookup, [], We) ->
    {flatten_tree(Lookup, []),We};
branch_out(Lookup, [{F,L,R}|T], We)->
    {F0,A0,We0} = distribute(L, We),
    {F1,A1,We1} = distribute(R, We0),
    branch_out(
        orddict:store(F, {F0,F1}, Lookup), [A0,A1|T], We1);
branch_out(Lookup, [_|T], We) ->
    branch_out(Lookup, T, We).

I still haven't found a suitable flattening principle though.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Messages In This Thread
Trying to implement BSP - any advice? (Solved) - by nemyax - 10-29-2014, 02:13 PM
RE: Trying to implement BSP - any advice? - by nemyax - 01-08-2015, 09:28 PM
RE: Trying to implement BSP - any advice? (Solved) - by micheus - 01-08-2015, 10:51 PM
RE: Trying to implement BSP - any advice? (Solved) - by nemyax - 01-12-2015, 10:07 PM

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode