You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Three.js uses a **right-handed Y-up** coordinate system:
704
+
-**X** = right (positive) / left (negative)
705
+
-**Y** = up (positive) / down (negative)
706
+
-**Z** = toward the viewer (positive) / away from the viewer (negative)
707
+
708
+
**Critical for vehicles and aircraft:** The fuselage/body extends along **Z** (nose at -Z, tail at +Z). Wings extend along **X** (left/right). The vertical stabilizer extends along **Y**.
709
+
710
+
When building an aircraft from primitives:
711
+
-**Fuselage** = cylinder or box, long axis along **Z** (use `geometry` default or rotate 90° around X)
712
+
-**Wings** = flat box, wide along **X**, thin along **Y**, short along **Z**
713
+
-**Tail fin** = flat box, tall along **Y**, thin along **X**, short along **Z**
714
+
715
+
```javascript
716
+
// Correct aircraft orientation example:
717
+
// Fuselage along Z
718
+
constfuselage=newTHREE.Mesh(
719
+
newTHREE.CylinderGeometry(0.15, 0.08, 2.0, 12),
720
+
material
721
+
);
722
+
fuselage.rotation.x=Math.PI/2; // CylinderGeometry default is Y-up, rotate to Z-forward
723
+
724
+
// Wings along X
725
+
constwing=newTHREE.Mesh(
726
+
newTHREE.BoxGeometry(2.5, 0.03, 0.4), // wide X, thin Y, short Z
727
+
material
728
+
);
729
+
730
+
// Vertical stabilizer along Y
731
+
consttailFin=newTHREE.Mesh(
732
+
newTHREE.BoxGeometry(0.03, 0.4, 0.3), // thin X, tall Y, short Z
733
+
material
734
+
);
735
+
tailFin.position.set(0, 0.2, 0.9); // above and behind
736
+
```
737
+
738
+
**Rotation axes for flight dynamics:**
739
+
-**Pitch** = rotation around **X** (nose up/down)
740
+
-**Roll** = rotation around **Z** (wings tilt)
741
+
-**Yaw** = rotation around **Y** (nose left/right)
742
+
743
+
**Common mistake:** Using the wing box as the fuselage (wide along X instead of Z). Always verify: the longest dimension of the fuselage should be along Z.
0 commit comments