Skip to content

Commit 1f036dd

Browse files
committed
fbx出力の座標軸を修正
1 parent 46be519 commit 1f036dd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/geometry/geo_reference.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ namespace plateau::geometry {
8686
// WUN → ENU の式は 逆変換 ENU → WUN と同じです。
8787
return { -vertex.x, vertex.z, vertex.y };
8888
case CoordinateSystem::ESU:
89-
// EUN → ESU の式は 逆変換 ESU → EUN と同じです。
89+
// ENU → ESU の式は 逆変換 ESU → ENU と同じです。
9090
return { vertex.x, -vertex.y, vertex.z };
9191
case CoordinateSystem::EUN:
9292
// EUN → ENU の式は 逆変換 ENU → EUN と同じです。

src/mesh_writer/fbx_writer.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,19 @@ namespace plateau::meshWriter {
4646
const auto fbx_scene = FbxScene::Create(manager_, "");
4747

4848
FbxAxisSystem axis_system;
49+
// FBXのデファクトは右手座標系です。
50+
// 左手座標系ではUnityやUEで正しく読み込めないことがあるため非推奨です。
4951
switch (options.coordinate_system) {
5052
case geometry::CoordinateSystem::ENU:
5153
axis_system = FbxAxisSystem(
5254
FbxAxisSystem::EUpVector::eZAxis,
53-
FbxAxisSystem::EFrontVector::eParityEven,
55+
FbxAxisSystem::EFrontVector::eParityOdd,
5456
FbxAxisSystem::eRightHanded);
5557
break;
5658
case geometry::CoordinateSystem::ESU:
5759
axis_system = FbxAxisSystem(
5860
FbxAxisSystem::EUpVector::eZAxis,
59-
FbxAxisSystem::EFrontVector::eParityEven,
61+
FbxAxisSystem::EFrontVector::eParityOdd,
6062
FbxAxisSystem::eLeftHanded);
6163
break;
6264
case geometry::CoordinateSystem::WUN:
@@ -68,7 +70,7 @@ namespace plateau::meshWriter {
6870
case geometry::CoordinateSystem::EUN:
6971
axis_system = FbxAxisSystem(
7072
FbxAxisSystem::EUpVector::eYAxis,
71-
FbxAxisSystem::EFrontVector::eParityEven,
73+
FbxAxisSystem::EFrontVector::eParityOdd,
7274
FbxAxisSystem::eLeftHanded);
7375
break;
7476
}

0 commit comments

Comments
 (0)