Perspective Transformation of 2.5D Orthographic Graphics

posted on: Saturday, 12th of April 2025

We updated Retro Commander to allow to render all 2.5D orthographic top-down graphics using a perspective transformation, to make it appear more 3D-like. Enable the "Parallax" option in the game's settings.

Perspective vs. 2.5D Orthographic Rendering

The perspective transformation should increase immersion by adding a 3D look and feel. The transformation matrix has been applied as follows to a 3D-Matrix. dx represents the intensity of the effect, e.g. 0.001. Rendering is orthographic if the value is 0.0.

  // source quad position (4 points)
  -1.00f     , -1.00f,
  +1.00f     , -1.00f,
  +1.00f     , +1.00f,
  -1.00f     , +1.00f,

  // target quad position (4 points)
  -1.00f     , -1.00f,
  +1.00f     , -1.00f,
  +1.00f + dx, +1.00f,
  -1.00f - dx, +1.00f

To counter the effect for objects on the maps, those objects are rendered with the transformation reversed. Otherwise, objects would be leaning towards the inside and make the 3D-effect go away.

  // calculate xL & xR based on their position on the screen
  xL = ...
  xR = ...

  // source quad position (4 points)
  -1.00f + xL, -1.00f,
  +1.00f + xR, -1.00f,
  +1.00f     , +1.00f,
  -1.00f     , +1.00f,

  // target quad position (4 points)
  -1.00f     , -1.00f,
  +1.00f     , -1.00f,
  +1.00f     , +1.00f,
  -1.00f     , +1.00f

There are few problem areas doing so.

Reference for Rendering Problems:

Perspective Transformation - Problem Areas

Download and test the feature now. The game is available from the following sites.

Reference Video: