[Reprint] Game and mathematics with an equal angle (45 degrees oblique)

Source: Internet
Author: User

Link: http://www.javaeye.com/articles/1225

In 1984, players in Europe were shocked by a game knight lore released at that time. The 2D game actually simulated the 3D environment, and the game's publishing platform was ZX Spectrum, with 48 k memory. This technology is isometric perspective ). Later, big pineapple and final fantasy games all adopted this projection technology.
An equal-angle projection is a type of projection that is within a certain range and is composed of two differential lines at any point on the projection surface. A Class of projection that is composed of two differential line segments on any point that remains unchanged before and after the angle projection. It is a projection that maintains the correct angle and shape, also known as a positive projection. This projection type is different from the perspective projection that is common in real 3D. It is scaled by the distance between an object and the camera. The projection angle of X, Y, and Z axes is 120 degrees. However, due to the features of rendering pixel images by computers and the ease of development, many games actually use second-class angle projection.
You can refer to this formula for the transformation from an equal-angle coordinate to a screen coordinate:

The screen coordinates are transformed to the equisigned coordinates:

The following is an excerpt from http://www.compuphase.com/axometr.htm:
The figure below shows a cube in the isometric projection as defined by ISO 5456-3.the first object from the left in the figure is the cube unadorned; the second object is the same cube with angles and measures annotated around it. the third and fourth graphics are the top and side views of the perspective scene and they give the camera position that fits the perspective view. the camera position is what you wowould feed into a 3D Renderer (or ray tracer) to create the sprites or tiles for the isometric projection.

Computer games with isometric maps are often tile-based. to make tiles match, the game designer must take into account how diagonal lines are plotted in discrete steps (bresenham and all that ). as it turns out, a line at 30 degrees (SINE is 0.5) produces steps that are too irregular. A line at an angle where the tangent is 0.5 does have a nice regular pattern: two steps to the right, one step up. thus, the isometric projection used by most games tilt the X-and Z-axes with approximately 27 degrees (the exact angle is "arctangent (0.5 )"). by the way, because the tangent of the angle of the fig is 0.5, the fig is twice as wide as it is high. this is why then sources mention a scale for isometric perspectives. (To make the edges of the fig match, the width of the fig and the height shocould be one pixel less than Border width. in other words, the height: width ratio of a fig is usually not exactly, but rather near. 1. this makes no difference for the principles of the isometric perspective .)
Again, the figure below shows what this isometric projection looks like.

The flash game uses a playfish restaurant with an equal-angle projection (you need to flip the wall ):

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.