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
@@ -13,6 +13,24 @@ FUN_0042ac50 MAP, FUN_00406d30 texture table, FUN_00556510 tile renderer).
|
||||
import math
|
||||
import struct
|
||||
|
||||
# ---------------------------------------------------------------- OBJ file space
|
||||
# OBJ files (geom_export/geom_import/geom_demo, the editor's Import mesh and OBJ/glTF export) are
|
||||
# right-handed, y up, in game space: file (x, y, z) = export (x, y, -z). The game shows export space
|
||||
# left-handed, so this is how Blender shows the level the same way round as the game. Converting
|
||||
# mirrors, so the corner order reverses (first corner kept: export (0,1,2) <-> file (0,2,1)).
|
||||
|
||||
|
||||
def to_file(p):
|
||||
"""Export-space point -> OBJ file point."""
|
||||
return (p[0], p[1], -p[2])
|
||||
|
||||
|
||||
def file_order(seq):
|
||||
"""Corner order export <-> file (an involution)."""
|
||||
seq = list(seq)
|
||||
return seq[:1] + seq[:0:-1]
|
||||
|
||||
|
||||
# ---------------------------------------------------------------- WAD
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user