J
James McGill
Hi, hope my question is not too abstract.
I'm drawing a square grid and I have mouse events that return
coordinates of that grid. Now I'd like to make that grid look like an
iso view. Illusion of 3D, seen from an oblique angle, as is typical in
conquest and exploration games.
Affine transform shear takes me close, but I think it's not going to get
me all the way. I think the problem is, I don't really want the
vertical lines to stay parallel, because that makes it look like the
"far end" is fatter, instead of converging to some vanishing point (The
squares in the grid should end up being trapezoidal, I think).
So two problems, 1., how to draw my grid in rectangular coords but have
it look like an iso view, and 2., how to translate the Point from the
mouse event, into the coordinates of my grid.
If Affine transform is still the way to go, I can keep studying it.
Right now I'm thinking I may actually need to work out the geometry of
the iso view, draw it explicitly, and then find the mouse coordinates by
iterating through the boundaries of my graph. This is nasty, since
AffineTransforms would make it so easy.
Maybe there's a better way I'm not thinking of, such as, instead of
bounding my grid by "lines", construct it from "shapes", and then I
could add a listener to each shape, or something like that. That sounds
treacherous too.
I'm drawing a square grid and I have mouse events that return
coordinates of that grid. Now I'd like to make that grid look like an
iso view. Illusion of 3D, seen from an oblique angle, as is typical in
conquest and exploration games.
Affine transform shear takes me close, but I think it's not going to get
me all the way. I think the problem is, I don't really want the
vertical lines to stay parallel, because that makes it look like the
"far end" is fatter, instead of converging to some vanishing point (The
squares in the grid should end up being trapezoidal, I think).
So two problems, 1., how to draw my grid in rectangular coords but have
it look like an iso view, and 2., how to translate the Point from the
mouse event, into the coordinates of my grid.
If Affine transform is still the way to go, I can keep studying it.
Right now I'm thinking I may actually need to work out the geometry of
the iso view, draw it explicitly, and then find the mouse coordinates by
iterating through the boundaries of my graph. This is nasty, since
AffineTransforms would make it so easy.
Maybe there's a better way I'm not thinking of, such as, instead of
bounding my grid by "lines", construct it from "shapes", and then I
could add a listener to each shape, or something like that. That sounds
treacherous too.