Hey all -
I am trying to make a perfectly optimized Sprite atlas. That means, given any collection of small sprites, I want to find (very quickly) a good way to cram them all into a big image with minimal waste. This essentially the same problem as the 2D cutting stock problem, for which I found this paper: http://www.inf.uos.de/papers_html/or_94/cutpaper.html . However, I don’t want to be able to rotate my sprites 90º, so this algorithm doesn’t fit my desires exactly.
So, I was wondering 2 things:
- Has anyone implemented this Java before? If so, would you be willing to share source so I can save myself time?
or - Does anyone have ideas on a good way to do this, given that rotations are not allowed? Genetic and other learning algorithms won’t really do the trick because they take a long time to get up to speed. At most, I want a wait of about 10 seconds for a 1024x1024 Atlas.