David Eisner wrote > >This isn't a real-world program, but I'm wondering how one >would improve the performance -- with the hope that any such >improvements might be applicable elsewhere. > >Thanks. > One thing that might help is to use a BSP (binary space partition) tree to store the positions of all the rectangles. Then, instead of comparing each rectangle to the clip box, ask the BSP tree to return a list of all rectangles within the clip box and draw them. That way you're not comparing every single rectangle to the box for each update. It can dramatically decrease the time taken to decide what to draw. The downside is that you have to rebuild the BSP tree if rectangles are moved.
-- Adrian BAAWA aa#128 Website : http://www.abarnett.demon.co.uk/atheism/ Message boards : http://pub45.ezboard.com/bwastelandofwonders Atheist shop : http://www.cafepress.com/cp/store/store.aspx?storeid=wow_atheism ( This outgoing email has been scanned for viruses. ) =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
