Graphics:Angle

From Adonthell
Revision as of 22:42, 13 April 2008 by Cirrus (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The game world is displayed by the Adonthell Engine as if it was viewed diagonally from above at a certain angle. Furthermore, the view is isometric so objects that are further away from the viewer do not appear smaller. The screenshot below illustrates this:

Since all the graphics in the game are just 2D bitmaps and not rendered in real-time 3D, it is up to the artists to create the illusion of a 3 dimensional world. To that end you need to decide from which angle you are looking down at the game world and design your graphics accordingly. The following diagram illustrates how the angle affects the vertical scaling of objects by taking a side-on view of the game world (imagine stepping into the game and looking at things from the left):

The "giant scary eye" represents our view on to the game world. If an object in the game world has a depth z then the eye sees it vertically compressed with a height z' (shown by the red line in the diagram). Similarly, an object's height y will be vertically compressed to y'. Since we use an isometric view there is no scaling in the horizontal dimension, so an object's width x will remain unchanged. The amount by which z and y need to be scaled is dependent on the angle A at which the eye looks down on the world. Some simple trigonometry yields the following formulae:

z' = sin(A) * z

y' = cos(A) * y

The Adonthell Engine does not mandate any particular viewing angle, so it is up to the designers of a game to choose one. For the official Adonthell games such as "Dun Barethsol" we have agreed on an angle of 41.8 degrees. It may be an odd sounding angle, but it gives some rather convenient scaling factors when plugged into the above formulae:

z' = 2/3 * z

y' = ~ 3/4 * y (it's actually 0.7454... but that's as good as 7.5)