Browse Source

update coordinate transform info in rendering doc

main
cinnaboot 6 months ago
parent
commit
7c6ee1ddec
  1. 6
      docs/rendering.md

6
docs/rendering.md

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

Loading…
Cancel
Save