Hey all,
This is a more general topic (general meaning non-engine-specific) so I figure this may be a better place to ask my question.
First off, a little background. I have a tile-loader which loads tiles which consist of a terrain-splatting technique and a heightmap. The TileManager class detects (based on your coordinates in the world) what “tile” you would be standing on, and then tries to find the heightmap file in the heightmap directory. If it can’t find it, it simply loads a default heightmap (to give us endless terrain).
I am creating my worlds (both heightmaps and texturing via alpha maps) in FreeWorld3D (www.freeworld3d.org), so I was wondering if anybody could offer input as to take a heightmap and cut it into smaller squares?
What I want to do is calculate how many new heightmaps will come out of the original (i.e. 1024 64x64 heightmaps from 1 2048x2048), then create them and name them appropriately. The naming will be very specific to my application and should be based on their coordinates within the image (i.e. 0,0.bmp; 1,1.bmp; 3,4.bmp).
Does anybody have some example code which can take a BMP image and create new smaller images based on subimages? If you do, I’d appreciate it very much.
I was originally using RAW heightmaps, but because of the difficulty of doing this conversion with RAW heightmaps I think I’ll be using BMP heightmaps.
-Tyler