If by terrain data you are referring to the terrain that has been
covered, then I am storing it all in memory even when part of it has
scrolled off of the screen. The application always has the vehicle
pointing up, so the terrain is constantly rotating depending on the
current heading of the vehicle. This rotating is done using an
AffineTransform on the terrain data. Are you suggesting breaking down
the terrain data into logical sections of images? If so, is there an
easy way to figure out which images would be in the viewing area at a
given time even with all of the transformations that are occuring
(rotation, scaling because of a zooming feature, translations)? I
understand that if there weren't any rotating going on (north is always
up, east is always right), I could store pieces on the hard drive and
access them when necessary. Unfortunately, this is not the
functionality.
Please let me know if you have any ideas.
Boudewijn Dijkstra - 19 Feb 2005 14:19 GMT
> If by terrain data you are referring to the terrain that has been
> covered, then I am storing it all in memory even when part of it has
[quoted text clipped - 3 lines]
> AffineTransform on the terrain data. Are you suggesting breaking down
> the terrain data into logical sections of images?
Yes.
> If so, is there an
> easy way to figure out which images would be in the viewing area at a
> given time even with all of the transformations that are occuring
> (rotation, scaling because of a zooming feature, translations)?
java.awt.Shape.intersects()
> I understand that if there weren't any rotating going on (north is always
> up, east is always right), I could store pieces on the hard drive and
> access them when necessary.
I think you still can. The pieces can be rotated too. However I don't know
whether the drawing algorithm is accurate enough to rotate them one by one or
whether the pieces must first be 'assembled' and then rotated.