mesh files use game space (right-handed, y up): obj/gltf import and export no longer mirror models, per-mesh handedness keeps meshes of old projects as they were, python tools follow (--export-space for the old files)
This commit is contained in:
1 parent
c4fa500198
commit
4a58910fba
26 files changed
+525
-96
No files matched your search
+15
-4
@@ -28,9 +28,18 @@ the spatial partition is the grid itself (cell lists) + a 32-zone visibility tab
|
||||
|
||||
## 2. Coordinate spaces [certain]
|
||||
|
||||
* **Export space** (= MAP floats "A", = vertex data of TRAK/STPC): right-handed, **y up**,
|
||||
grid cells lie at x ∈ [0,W), **z ∈ (−H, 0]**. The OBJ export uses this space.
|
||||
* **Export space** (= MAP floats "A", = vertex data of TRAK/STPC): **y up**, grid cells lie at
|
||||
x ∈ [0,W), **z ∈ (−H, 0]**. The engine draws it with a Direct3D camera, i.e. **left-handed**:
|
||||
a right-handed tool shows export-space data mirrored (see editor-render.md).
|
||||
* **Game space** (MAP fixed point "B", collision, strats): (x, y, −z), 20.12 fixed point (4096 = 1).
|
||||
As the game shows it, game space is **right-handed** (y up).
|
||||
* **File space** (OBJ/glTF of all tools, since 2026-11-07) = game space: right-handed, y up,
|
||||
z > 0 in the grid, so Blender shows a level the same way round as the game and a model from
|
||||
Blender appears in game as modelled. Converting export ↔ file negates z and reverses the corner
|
||||
order (first corner kept: export (0,1,2) ↔ file (0,2,1); `geomlib.to_file/file_order`).
|
||||
Used by `geom_export`/`geom_import`/`geom_demo` (`--export-space` = old raw export space, z < 0),
|
||||
the editor's Import mesh, OBJ export and glTF export. Verified in game and Blender with an
|
||||
asymmetric "F" (`img/editor/handed_*.jpg`, editor-tools-geometry.md).
|
||||
The renderer converts B back: pos = (Bx, By, −Bz)/4096, angle = rot·2π/4096.
|
||||
* Tile transform (local vertex v → world, export space), a = rot/4096·2π:
|
||||
`X = x + vx·cos a − vz·sin a ; Y = y + vy ; Z = z + vx·sin a + vz·cos a`
|
||||
@@ -197,9 +206,11 @@ Implemented in `tools/geom_import.py` (OBJ → TRAK + MAP tile part, rest of the
|
||||
* Whether the player start point/camera is coupled to geometry (objects.md).
|
||||
|
||||
## 10. Tools
|
||||
* `geom_export.py WAD OUT [--collision] [--objects]` → level.obj/mtl (UV, vertex colours, one
|
||||
* OBJ files of all three tools are file space = game space (section 2); `--export-space` on
|
||||
`geom_export`/`geom_import` = the old raw export space (z < 0).
|
||||
* `geom_export.py WAD OUT [--collision] [--objects] [--export-space]` → level.obj/mtl (UV, vertex colours, one
|
||||
object per tile), page_NN.png, collision.obj (groups matNN_grpG), objects.obj, preview_top/persp.png
|
||||
(textured software renderer).
|
||||
* `geom_import.py BASE.wad MESH.obj NEW.wad [--coll-obj C.obj] [--keep-tiles] [--zones flat|keep] [--default-tex N]`
|
||||
* `geom_import.py BASE.wad MESH.obj NEW.wad [--coll-obj C.obj] [--keep-tiles] [--zones flat|keep] [--default-tex N] [--export-space]`
|
||||
* `geom_demo.py BASE.wad demo.obj [--plaza]` – example geometry made of texture-tile quads.
|
||||
* `geomlib.py` – parser/builder (TRAK, STPC models, MAP tile part, TEXT table/pages, collision).
|
||||
Reference in new issue
Block a user