|
|
|
|
@ -28,7 +28,7 @@ struct RenderState {
|
|
|
|
|
The simulation uses an XY plane while rendering uses XZ plane (Y is up in raylib). |
|
|
|
|
|
|
|
|
|
**Transformation:** |
|
|
|
|
- Simulation (X, Y, Z) → Render (X, -Z, Y) |
|
|
|
|
- Simulation (X, Y, Z) → Render (X, Z, -Y) |
|
|
|
|
- 90-degree rotation around X-axis |
|
|
|
|
|
|
|
|
|
**Implementation:** |
|
|
|
|
@ -36,8 +36,8 @@ The simulation uses an XY plane while rendering uses XZ plane (Y is up in raylib
|
|
|
|
|
Vector3 sim_to_render(Vec3 pos, double scale) { |
|
|
|
|
return (Vector3){ |
|
|
|
|
(float)(pos.x * scale), |
|
|
|
|
(float)(-pos.z * scale), |
|
|
|
|
(float)(pos.y * scale) |
|
|
|
|
(float)(pos.z * scale), |
|
|
|
|
(float)(-pos.y * scale) |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
``` |
|
|
|
|
|