This topic is now archived and is closed to further replies.

X-Factor Studios

3D to iso help

Recommended Posts

I was wondering if someone could help me figure out how to take a 3D model and slice it up into tiles so it will work in an isometric game. Heres the situation - we have a whole bunch of 3D models already made which we were using for a previous game that we put on hold for now - such as buildings, etc. We are instead making a 2D isometric strategy game and would like to use the models from the previous game in this game. Of course the models will need to be converted to 2D images and then sliced up somehow so they will work as tiles. Is there a tool out there that will simplify this process? If not, could someone explain the porcess? Any help would be appreciated BTW, the tile size we are using is 64x32 if that makes any difference... Jeremy DenHartog CEO/Designer for X-Factor Studios [edited by - X-Factor Studios on May 3, 2002 1:35:14 AM]

Share this post

Link to post
Share on other sites
Demiurge    122
long post ahead, you may opt to skip to the tile splicing suggestions:
Method 1
Method 2

here's a suggestion on creating images from models:
load up your modeling program, and whatever object(s) you will be wanting together in 1 image.
create an animation of them rotating around (0,0,0), each frame is another side of the object you want to be able to rotate in the game. if only 1 then just render and save the output image.
if it's an animation, render as many frames as directions you want to rotate (like for a character probably 8 or 16), and instead of saving individual images have it save the output to "image_xxx.yyy" so it does image_001, image_002 etc, and you have as many pictures as you need.
also, for a character, create more frames for each direction in every walking/moving frame you want and render those.

anything you want to display on a single tile, you should unify all moving and directional frames into a single tileset.
those bigger things, you should treat as if it were a texture. tanstaafl explains this in his book, in chapter20, although i haven't read that part yet, i'd suggest the following:

first approach; more time consuming before, less during:
1.make image a little bigger, with transparent color added on edges.
2.load image into program
3.make a matrix of tiles big enough to turn your image into a staggered map, arbitrarily setting the number of tiles to the image width/height divided by the tile measurements.
4.take what TANS calls a 'mousemap' - a tile image, with white in the tile area and 4 different corner colors, and make all corners the same color to cut back on useless checks, or alternately use a matrix of booleans, the size of a tile, with one value for tile area and another for corner areas.
5.iterate through your tile matrix, and using the above 'tile mask', for each pixel actually in the tile area, grab the color value from the big image and put in the tile's surface whatever.
if you want, you can dump the big image surface when you're done with this..

in this way you have all the tiles pre-stored

2nd approach; more time consuming during, less before:
once again load the image into the program and have it stored in a surface whatever (i say whatever because i don't know how it works if you're using something other than directx).
now, instead of a seperate tile matrix, just use your tile map to say if it has the specific building on it or not (if it's only 1 building then yes/no, if more than one then the number of the building in an array or whatever..).
then, when you've checked that a tile with a piece of the building is on the screen, you calculate the tile's anchor minus that of the top-leftmost tile that has the building in it. that is, that which corresponds to the upper left part of the building itself. the location in the building surface whatever, will be (0 + (tile X's anchor - tile 1's anchor)).
then, create a temporary surface whatever, the size of a tile, again with one color in tile area and another in corners, and blit from the image to that in the size of a tile RECT (just like you would probably do in the previous method instead of picking individual pixels), using a destination colorkey which is that of the corners so as to avoid filling those parts, and blit from this temporary to the backbuffer or whatever you draw the map on, and then destroy this temporary tile surface.
or alternately, keep it a global or something similar that can be accessed by all tiles and just keep blitting to that without the corners and from that to the map..

Make something idiot proof, and someone will make a better idiot..

edit: ok so shoot me it wasn't THAT long, but i love using <a name>'s

[edited by - Demiurge on May 3, 2002 11:54:21 AM]

Share this post

Link to post
Share on other sites