hey van
im working on my testbed for the interpolation thing and i was wondering what you would recommend for choosing the tile and getting new color points
as it is right now im looping through each tile and checking the one in front of it to get the new color points
this is a pretty horrible method as you can imagine. i was wondering what your thoughts were on this
also the color seems to always be grayscale on the function you hooked me up with
but im sure i can fix that
EDIT: heres the gist of my code
rem the transition loop
for i=2 to 4
for j=2 to 4
rem the transition garbage
`first check to see if adjacent tiles are different
if (tiles(i, j) <= 8) AND (tiles(i, j) <> tiles(i-1, j)) OR (tiles(i, j) <> tiles(i+1, j)) OR (tiles(i, j) <> tiles(i, j-1)) OR (tiles(i, j) <> tiles(i, j+1))
`now loop for each pixel in the texture
for n=0 to 63
for m = 0 to 63
`simple hypotenuse to the corner of the tile
distance# = sqrt((n*n) + (m*m))/64
`grab a pixel from the tile on a 2x4 matrix of tiles
color1 = point((mod(tiles(i, j)+1, 2) * 64)+m, (tiles(i, j)/2)*64+n)
`grab a pixel from an adjacent tile
color2 = point((mod(tiles(i, j+1)+1, 2) * 64)+m, (tiles(i, j+1)/2)*64+n)
`create a new tile with the interpolated pixel
dot n + (ctilex*64), m + (tilez*64), MixCol(color1, color2, distance#)
next m:
next n
`save the new tile number
tiles(i, j) = (ctilex+1)*tilez
`keep track of the total number of tiles
ctilex = ctilex + 1
if ctilex > tilex
ctilex = 0
tilez = tilez + 1
endif
endif
next j
next i
`get the image from the bitmap
get image 33, 0, 0, tilex*64, tilez*64, 0
`save the new tile map (temporary
save image "blah.jpg", 33
set current bitmap 0