Using Anisotropic Mapping Mode
- - - - - - - - - - - - - - - - - - - - - - - -
In the previous two lessons we discussed how the drawing area of a component
can be redefined from the user's (programmer's) point of view to change the
way pixels are addressed. Ultimately these logical coordinates must be
translated into device coordiantes. Also many different logical coordinate
systems can be designed to match the needs of particular users
(programmers). It is also possible for the programmer to work in device
coordinates and present a draw area to the user of the applet (game player
or lesson taker) in some specially designed logical system. For instance,
the logical system used for Bingo or Battleship must be traslated into
device coordinates at some point. For instance, the logical coordinate
system a tic tac toe player must deal with is a 3X3 grid which may be
addressed like so: (2,2) for the center cell. In device coordinates the
logical coordinates (2,2) may well correspond to a range of device units,
say (50,50) through (75,75) depending on the presentation of the tic tac toe
grid.
In this lesson we will work with resizeable, anisotropic draw areas. Take
time to inspect, compile, and test the following applet:
Diagonal Line in Anisotropic Mode
- - - - - - - - - - - - - - - - - - - - - - - -
ASSIGNMENT:
You will create a resizeable, anisotropic tic tac toe grid. Replicate the
appearance AND behavior of this applet.
|
|