I have been working on a 2D Isometric Terrain system that mimics
the old
SimCity 2000 terrain system.
Getting pieces to line up and connect properly has not really been a
problem.
The issue I am trying to iron out know, is making the terrain
editable in
real-time.
I settled on a Matrix that represents the level of any tile on the
board,
where the lowest possible tile is 1.
Example - 7x7 tile grid:
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
When say the center tile is raised to level 4, the output should
become
1 1 1 1 1 1 1
1 2 2 2 2 2 1
1 2 3 3 3 2 1
1 2 3 4 3 2 1
1 2 3 3 3 2 1
1 2 2 2 2 2 1
1 1 1 1 1 1 1
So far, I have achieved this "slinky" effect by taking the raised
tile and
setting the heights of each outer ring to one less than the raised
tile,
etc, etc.
What I can't seem to layout mathematically is taking in to account
other
tiles in the area that may have already been raised.
ex: Given the previous raised state, I raise the tile to the right
of the
center one to 4 as well. Its output should look like this:
1 1 1 1 1 1 1
1 2 2 2 2 2 2
1 2 3 3 3 3 2
1 2 3 4 4 3 2
1 2 3 3 3 3 2
1 2 2 2 2 2 2
1 1 1 1 1 1 1
Is there a known formula for this kind of matrix transformation?
Where every
matrix(x,y)'s value directly effects all surrounding values do
produce a
smooth transition/staircase effect?
Doing google searches for various matrix types and examples have
not turned
up much. It just seems like this would be a formula that is sitting
in the
matrix section of some math book. I would like to rule out the
possible
availability of such a formula before I go beating my head against
the wall
calculating it myself.
Thanks,
-Seth
--
<http://realopen.org>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>