Hi,
I'm having trouble figuring out the best way to draw a large grid of objects.
I need to be able to catch which cells have been clicked and change the object at that location. (either place or remove an object)
I also want to be able to save the (relevant part of the) grid in a bitmask or similar, to be able to save it to file, e.g.:
1 1 1 1 1
1 0 0 0 0
1 0 1 0 0
0 0 0 0 1
1 1 1 1 1
Also, zoom in/out functionality would be nice…
Things I've come up with:
- Using GeometryBatchCreator to make a grid of instances of boxes/quads. Slow on large grids, frustum culling doesn't seem to work.
- Using shingoki's Grid class, found on these forums. Slow on large grids, frustum culling doesn't seem to work.
- Using ProjectedGrid. Fast, but I think it's not suited since the grid reso looks the same at all zoomlvls and cells can't be isolated. (?)
- Using a line group with horizontal and vertical lines in one array. Fast. Picking and cell-isolation tricky… (?)
- Brute force adding objects to the rootNode. Huge memory load. Slow. Only one where picking is easy though…
I thought I'd check here first, before I start implementing dynamic off-screen cell-adding/-loading stuff, although that might be needed anyway?
Any thoughts?
Thanks in advance,
Alex