1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-02 19:56:13 +01:00

Fix code blocks

Olivier Wervers
2018-06-23 14:47:17 +02:00
parent f1b093ec85
commit 7d89eade0d

@@ -3,16 +3,23 @@ This page is dedicated to showing common angles and distances and their mathemat
Results on this page have been rounded to 4 decimal places.
For simplicity sake, we'll use 1 as our base unit.
```Tile size = 1```
```
Tile size = 1
```
The unit height, however, isn't 1. As you may know an object with a unit height of 2 will align it's top perfectly with a tile behind it. We know that our camera is rotated by 45 degrees and looking down by 30. We can calculate the unit height by creating a right-angled triangle where the height is 2 times the unit height, which we want to know, the angle is our vertical camera angle and the adjacent is the diagonal of a tile. We know 2 things about our triangle and thus we can calculate what the height of it is and divide it by 2:
```Tile diagonal = 1.4142 = sqrt(1² + 1²)
Unit height = 0.4082 = tan(30°) * 1.4142 / 2```
```
Tile diagonal = 1.4142 = sqrt(1² + 1²)
Unit height = 0.4082 = tan(30°) * 1.4142 / 2
```
Now that we know our unit height we can start to calculate some of the angles that we see in the for track rides, terrain and scenery objects such as roofs:
```Gentle slope angle = 22.2052° = atan(0.4082 / 1)
```
Gentle slope angle = 22.2052° = atan(0.4082 / 1)
Diagonal gentle slope angle = 16.1005°
Steep slope angle = 58.5148° = atan(0.4082 * 4 / 1)
Diagonal steep slope angle = 49.1035° = atan(0.4082 * 4 / 1.4142)```
Diagonal steep slope angle = 49.1035° = atan(0.4082 * 4 / 1.4142)
```
The unit height for RCT was not mathematically correct when it comes to the pre-rendered sprites. What the exact value used was is unknown but based on info from Simon Foster it seems like it was eyeballed.