Skip to main content
replaced http://gamedev.stackexchange.com/ with https://gamedev.stackexchange.com/
Source Link

To keep things simple, I'd do the following:

We assume as a starting point something like your target tile shape at the top - a 1-bit bitmap which I assume tesselates correctly - if not, get the tesselation working first.

Create a Tuple<float, float> array[64][31] reflecting the target pixels. Each such array cell is a UV coordinate (0.0->1.0 exclusive range) into any existing image you'd like to project into isometric space. For cells that aren't part of the tile, just use e.g. Float.MaxValue for x and y (and remember to check for those and skip them when processing - see below). For all valid cells, read on.

Populating valid cells is a matter of using a mapping formula from iso to ortho space, i.e. "for some isometric [x,y], what is the corresponding [x,y] in ortho space?" - this allows you to get the texel you want at the position you want it in the iso tile. There are plenty of posts around on isometric conversion formulae, see for example this answerthis answer. The end result is essentially that you will map every isometric-space tuple to an image-space UV coordinate.

Once you've populated this conversion array with the mappings, you could write a nice wrapper function that uses the mappings for any tile that wants to populate itself from an image:

tile = new Tile();
tile.FromImage("/images/myimage.jpg");

...which will run through the isometric array tuples and pull the corresponding coordinates from the named image, and possibly apply some smoothing / subtexel sampling.

To keep things simple, I'd do the following:

We assume as a starting point something like your target tile shape at the top - a 1-bit bitmap which I assume tesselates correctly - if not, get the tesselation working first.

Create a Tuple<float, float> array[64][31] reflecting the target pixels. Each such array cell is a UV coordinate (0.0->1.0 exclusive range) into any existing image you'd like to project into isometric space. For cells that aren't part of the tile, just use e.g. Float.MaxValue for x and y (and remember to check for those and skip them when processing - see below). For all valid cells, read on.

Populating valid cells is a matter of using a mapping formula from iso to ortho space, i.e. "for some isometric [x,y], what is the corresponding [x,y] in ortho space?" - this allows you to get the texel you want at the position you want it in the iso tile. There are plenty of posts around on isometric conversion formulae, see for example this answer. The end result is essentially that you will map every isometric-space tuple to an image-space UV coordinate.

Once you've populated this conversion array with the mappings, you could write a nice wrapper function that uses the mappings for any tile that wants to populate itself from an image:

tile = new Tile();
tile.FromImage("/images/myimage.jpg");

...which will run through the isometric array tuples and pull the corresponding coordinates from the named image, and possibly apply some smoothing / subtexel sampling.

To keep things simple, I'd do the following:

We assume as a starting point something like your target tile shape at the top - a 1-bit bitmap which I assume tesselates correctly - if not, get the tesselation working first.

Create a Tuple<float, float> array[64][31] reflecting the target pixels. Each such array cell is a UV coordinate (0.0->1.0 exclusive range) into any existing image you'd like to project into isometric space. For cells that aren't part of the tile, just use e.g. Float.MaxValue for x and y (and remember to check for those and skip them when processing - see below). For all valid cells, read on.

Populating valid cells is a matter of using a mapping formula from iso to ortho space, i.e. "for some isometric [x,y], what is the corresponding [x,y] in ortho space?" - this allows you to get the texel you want at the position you want it in the iso tile. There are plenty of posts around on isometric conversion formulae, see for example this answer. The end result is essentially that you will map every isometric-space tuple to an image-space UV coordinate.

Once you've populated this conversion array with the mappings, you could write a nice wrapper function that uses the mappings for any tile that wants to populate itself from an image:

tile = new Tile();
tile.FromImage("/images/myimage.jpg");

...which will run through the isometric array tuples and pull the corresponding coordinates from the named image, and possibly apply some smoothing / subtexel sampling.

added 114 characters in body
Source Link
Engineer
  • 30.3k
  • 4
  • 75
  • 123

To keep things simple, I'd do the following:

We assume as a starting point something like your target tile shape at the top - a 1-bit bitmap which I assume tesselates correctly - if not, get the tesselation working first.

Create a Tuple<float, float> array[64][31] reflecting the target pixels. Each such array cell is a UV coordinate (0.0->1.0 exclusive range) into the originalany existing image you'd like to project onto yourinto isometric tile formatspace. For cells that aren't part of the tile, just use e.g. Float.MaxValue for x and y (and remember to check for those and skip them when processing - see below). For all valid cells, read on.

Populating valid cells is a matter of using a mapping formula from iso to ortho space, i.e. "for some isometric [x,y], what is the corresponding [x,y] in ortho space?" - this allows you to get the texel you want at the position you want it in the iso tile. There are plenty of posts around on isometric conversion formulae, see for example this answer. The end result is essentially that you will map every isometric-space tuple to an image-space UV coordinate.

Once you've populated this conversion array with the mappings, you could write a nice wrapper function that uses the mappings for any tile that wants to populate itself from an image:

tile = new Tile();
tile.FromImage("/images/myimage.jpg");

...which will run through the isometric array tuples and pull the corresponding coordinates from the named image, and possibly apply some smoothing / subtexel sampling.

To keep things simple, I'd do the following:

We assume as a starting point something like your target tile shape at the top - a 1-bit bitmap which I assume tesselates correctly - if not, get the tesselation working first.

Create a Tuple<float, float> array[64][31] reflecting the target pixels. Each such array cell is a UV coordinate (0.0->1.0 exclusive range) into the original image you'd like to project onto your isometric tile format. For cells that aren't part of the tile, just use e.g. Float.MaxValue for x and y (and remember to check for those and skip them when processing - see below). For all valid cells, read on.

Populating valid cells is a matter of using a mapping formula from iso to ortho space, i.e. "for some isometric [x,y], what is the corresponding [x,y] in ortho space?" - this allows you to get the texel you want at the position you want it in the iso tile. There are plenty of posts around on isometric conversion formulae, see for example this answer. The end result is essentially that you will map every isometric-space tuple to an image-space UV coordinate.

Once you've populated this conversion array with the mappings, you could write a nice wrapper function that uses the mappings for any tile that wants to populate itself from an image:

tile = new Tile();
tile.FromImage("/images/myimage.jpg");

...which will run through the isometric array tuples and pull the corresponding coordinates from the named image, and possibly apply some smoothing / subtexel sampling.

To keep things simple, I'd do the following:

We assume as a starting point something like your target tile shape at the top - a 1-bit bitmap which I assume tesselates correctly - if not, get the tesselation working first.

Create a Tuple<float, float> array[64][31] reflecting the target pixels. Each such array cell is a UV coordinate (0.0->1.0 exclusive range) into any existing image you'd like to project into isometric space. For cells that aren't part of the tile, just use e.g. Float.MaxValue for x and y (and remember to check for those and skip them when processing - see below). For all valid cells, read on.

Populating valid cells is a matter of using a mapping formula from iso to ortho space, i.e. "for some isometric [x,y], what is the corresponding [x,y] in ortho space?" - this allows you to get the texel you want at the position you want it in the iso tile. There are plenty of posts around on isometric conversion formulae, see for example this answer. The end result is essentially that you will map every isometric-space tuple to an image-space UV coordinate.

Once you've populated this conversion array with the mappings, you could write a nice wrapper function that uses the mappings for any tile that wants to populate itself from an image:

tile = new Tile();
tile.FromImage("/images/myimage.jpg");

...which will run through the isometric array tuples and pull the corresponding coordinates from the named image, and possibly apply some smoothing / subtexel sampling.

added 114 characters in body
Source Link
Engineer
  • 30.3k
  • 4
  • 75
  • 123

To keep things simple, I'd do the following:

We assume as a starting point something like your target tile shape at the top - a 1-bit bitmap which I assume tesselates correctly - if not, get the tesselation working first.

Create a Tuple<float, float> array[64][31] reflecting the target pixels. Each such array cell is a UV coordinate (0.0->1.0 exclusive range) into the original image you'd like to project onto your isometric tile format. For cells that aren't part of the tile, just use e.g. Float.MaxValue for x and y (and remember to check for those and skip them when processing - see below). For all valid cells, read on.

Populating thisvalid cells is a matter of using a mapping formula from iso to ortho space, i.e. "for some isometric [x,y], what is the corresponding [x,y] in ortho space?" - this allows you to get the texel you want at the position you want it in the iso tile. There are plenty of posts around on isometric conversion formulae, see for example this answer. The end result is essentially that you will map every isometric-space tuple to an image-space UV coordinate.

Once you've populated this conversion array with the mappings, you could write a nice wrapper function that uses the mappings for any tile that wants to populate itself from an image:

tile = new Tile();
tile.FromImage("/images/myimage.jpg");

...which will run through the isometric array tuples and pull the corresponding coordinates from the named image, and possibly apply some smoothing / subtexel sampling.

To keep things simple, I'd do the following:

We assume as a starting point something like your target tile shape at the top - a 1-bit bitmap which I assume tesselates correctly - if not, get the tesselation working first.

Create a Tuple<float, float> array[64][31]. Each such array cell is a UV coordinate (0.0->1.0 exclusive range) into the original image you'd like to project onto your isometric tile format. For cells that aren't part of the tile, just use e.g. Float.MaxValue for x and y (and remember to check for those and skip them when processing - see below).

Populating this is a matter of using a mapping formula from iso to ortho space . There are plenty of posts around on isometric conversion formulae, see for example this answer. The end result is essentially that you will map every isometric-space tuple to an image-space UV coordinate.

Once you've populated this conversion array with the mappings, you could write a nice wrapper function that uses the mappings for any tile that wants to populate itself from an image:

tile = new Tile();
tile.FromImage("/images/myimage.jpg");

...which will run through the isometric array tuples and pull the corresponding coordinates from the named image, and possibly apply some smoothing / subtexel sampling.

To keep things simple, I'd do the following:

We assume as a starting point something like your target tile shape at the top - a 1-bit bitmap which I assume tesselates correctly - if not, get the tesselation working first.

Create a Tuple<float, float> array[64][31] reflecting the target pixels. Each such array cell is a UV coordinate (0.0->1.0 exclusive range) into the original image you'd like to project onto your isometric tile format. For cells that aren't part of the tile, just use e.g. Float.MaxValue for x and y (and remember to check for those and skip them when processing - see below). For all valid cells, read on.

Populating valid cells is a matter of using a mapping formula from iso to ortho space, i.e. "for some isometric [x,y], what is the corresponding [x,y] in ortho space?" - this allows you to get the texel you want at the position you want it in the iso tile. There are plenty of posts around on isometric conversion formulae, see for example this answer. The end result is essentially that you will map every isometric-space tuple to an image-space UV coordinate.

Once you've populated this conversion array with the mappings, you could write a nice wrapper function that uses the mappings for any tile that wants to populate itself from an image:

tile = new Tile();
tile.FromImage("/images/myimage.jpg");

...which will run through the isometric array tuples and pull the corresponding coordinates from the named image, and possibly apply some smoothing / subtexel sampling.

added 58 characters in body; added 67 characters in body
Source Link
Engineer
  • 30.3k
  • 4
  • 75
  • 123
Loading
added 58 characters in body
Source Link
Engineer
  • 30.3k
  • 4
  • 75
  • 123
Loading
Source Link
Engineer
  • 30.3k
  • 4
  • 75
  • 123
Loading