<p>What they're using in this game is called an <a href="https://en.wikipedia.org/wiki/Orthographic_projection" rel="nofollow noreferrer">orthographic projection</a>. It is a special type of a projection, which does not bend objects, it does not mean that they are not using 3D. </p>

<p>Now, of course you can achieve this kind of effect using 2D coordinates only if you want. But it requires some mathematical understanding of the situation, as you need to do 3D calculations in order to calculate the correct 2D coordinates to use. If you do it this way, you can draw points or lines between the points after calculating the positions, and it  will give the effect you want. </p>

<p>But here in RotMG, they are also doing texture mapping on those walls, which uses information about the actual size of the surface in 3D space. This information is lost if you simply calculate the 2D positions of the corners without also doing the texture mapping yourself. </p>

<p>So here you have two options:</p>

<ul>
<li>You can give up your console and start doing some real 3D stuff (OpenGL, etc...).</li>
<li>You can become very good at linear algebra, preferably including <a href="https://en.wikipedia.org/wiki/Homogeneous_coordinates" rel="nofollow noreferrer">homogenous coordinates</a>, project the points from 3D to 2D space, draw your lines/points in your console, or interpolate the 3D positions with some form of rasterization, if you want to decorate the wall using texture mapping. But once you understand all of that, I'm afraid you won't want to use your limited console anymore. </li>
</ul>

CC BY-SA 3.0
2018-02-08T22:02:25.857Z
2018-02-08T22:09:14.723Z
2018-02-08T22:09:14.723Z
unknown
<p>I wanted to make a little demo for a console with Realm of the Mad God esc graphics to brush up my C and SDL skills.</p>

<p><a href="https://i.sstatic.net/AtTDe.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/AtTDe.png" alt="View of the walls I&#39;m trying to recreate"></a> </p>

<p>One problem I'm running in to is creating the 3D walls. 
The console I'm working with does not actually allow for 3D hardware acceleration at this moment of time and thus I can't really use real 3D. 
I noticed the perspective looked off in RotMG as well so I figured they must be using fake 3D also.</p>

<p>Now I have tried layering 2d textures on top of eachother as detailed <a href="http://www.like100bears.com/writing/2d-3d-in-gamemaker-studio" rel="nofollow noreferrer">here</a> although this didn't quite work out so I modified the algorithm a bit and the blocks looked a lot better. Problem is they wouldn't sit next to eachother convincingly so I figured this is not the right tool for the job.</p>

<p>What type of algorithm should I use to recreate the 3D walls without actually using GL or other real 3D technologies?</p>

CC BY-SA 4.0
2021-02-17T16:11:34.143Z
Have you considered creating the walls in a 3D app (and only the walls) you could use opengl to program it up, or just use something like blender to create them. Then set up a handful of camera angles to take snapshots. Save those snap shots to an atlas, and just use the saved snapshots. If you camera angle is fixed, and the walls are all axis aligned, then you really only need a handful of views. At draw time, elements on the same side of the wall as the camera are drawn over the wall, elements on the opposite  side of the wall from the camera get the wall draw on them.
pmw1234
CC BY-SA 4.0
2021-02-17T16:15:28.590Z
It just occurred to me that another way to draw the walls is via ray casting similar to how Wolfenstein used ray casting, but that could have game wide ramifications. But it frees the camera to change angles.
pmw1234
<3d><transformations><2d>
What technique would I use to create fake 3d walls as seen in Realm of the Mad God
Daan
# What technique would I use to create fake 3d walls as seen in Realm of the Mad God

(Asked by: username_0 on 2018-02-08)

I wanted to make a little demo for a console with Realm of the Mad God esc graphics to brush up my C and SDL skills.

[![View of the walls I'm trying to recreate](https://i.sstatic.net/AtTDe.png)](https://i.sstatic.net/AtTDe.png)

One problem I'm running in to is creating the 3D walls.
The console I'm working with does not actually allow for 3D hardware acceleration at this moment of time and thus I can't really use real 3D.
I noticed the perspective looked off in RotMG as well so I figured they must be using fake 3D also.

Now I have tried layering 2d textures on top of eachother as detailed [here](http://www.like100bears.com/writing/2d-3d-in-gamemaker-studio) although this didn't quite work out so I modified the algorithm a bit and the blocks looked a lot better. Problem is they wouldn't sit next to eachother convincingly so I figured this is not the right tool for the job.

What type of algorithm should I use to recreate the 3D walls without actually using GL or other real 3D technologies?

**Tags:** 3d, transformations, 2d

> **Comments:**
> **username_1**: Have you considered creating the walls in a 3D app (and only the walls) you could use opengl to program it up, or just use something like blender to create them. Then set up a handful of camera angles to take snapshots. Save those snap shots to an atlas, and just use the saved snapshots. If you camera angle is fixed, and the walls are all axis aligned, then you really only need a handful of views. At draw time, elements on the same side of the wall as the camera are drawn over the wall, elements on the opposite  side of the wall from the camera get the wall draw on them.  
> **username_1**: It just occurred to me that another way to draw the walls is via ray casting similar to how Wolfenstein used ray casting, but that could have game wide ramifications. But it frees the camera to change angles.  

---

## 1 answers

### Answer by username_2 on 2018-02-08. Score: 3

What they're using in this game is called an [orthographic projection](https://en.wikipedia.org/wiki/Orthographic_projection). It is a special type of a projection, which does not bend objects, it does not mean that they are not using 3D.

Now, of course you can achieve this kind of effect using 2D coordinates only if you want. But it requires some mathematical understanding of the situation, as you need to do 3D calculations in order to calculate the correct 2D coordinates to use. If you do it this way, you can draw points or lines between the points after calculating the positions, and it will give the effect you want.

But here in RotMG, they are also doing texture mapping on those walls, which uses information about the actual size of the surface in 3D space. This information is lost if you simply calculate the 2D positions of the corners without also doing the texture mapping yourself.

So here you have two options:

* You can give up your console and start doing some real 3D stuff (OpenGL, etc...).
* You can become very good at linear algebra, preferably including [homogenous coordinates](https://en.wikipedia.org/wiki/Homogeneous_coordinates), project the points from 3D to 2D space, draw your lines/points in your console, or interpolate the 3D positions with some form of rasterization, if you want to decorate the wall using texture mapping. But once you understand all of that, I'm afraid you won't want to use your limited console anymore.


---

