summaryrefslogtreecommitdiff
path: root/tools/blender_export.py
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-08 14:25:34 +0100
committerskal <pascal.massimino@gmail.com>2026-02-08 14:25:34 +0100
commitc68817059b882506bacc09694b0ac58dbe6c13a6 (patch)
treee7989a3df7aa5769169ffa3477769db140688a2f /tools/blender_export.py
parent50edd9f0e0565be643dda467bc240d9281277a8c (diff)
feat: Integrate plane_distance into renderer and scene loader
This commit integrates the plane_distance functionality by: - Adding shared_user_data to Object3D for storing type-specific data. - Modifying SceneLoader to read and store plane_distance in shared_user_data for PLANE objects. - Updating ObjectData struct in renderer.h to use params.x for object type and params.y for plane_distance. - Modifying Renderer3D::update_uniforms to populate ObjectData::params.y with plane_distance for PLANE objects. - Adjusting blender_export.py to correctly export plane_distance and reorder quaternion components. A manual step is required to update WGSL shaders to utilize ObjectData.params.y for plane distance calculations.
Diffstat (limited to 'tools/blender_export.py')
-rw-r--r--tools/blender_export.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/blender_export.py b/tools/blender_export.py
index c4a45ff..fb800ac 100644
--- a/tools/blender_export.py
+++ b/tools/blender_export.py
@@ -71,14 +71,11 @@ def export_scene(filepath):
rot = obj.rotation_quaternion
scale = obj.scale
- # Position
- # For now, exporting raw Blender coordinates.
- # We can fix coordinate system in C++ or here if decided.
- # Keeping raw for now to avoid confusion until verified.
- f.write(struct.pack('<3f', pos.x, pos.y, pos.z))
+ # Position: Convert Blender Z-up (x,y,z) to engine Y-up (x,z,-y)
+ f.write(struct.pack('<3f', pos.x, pos.z, -pos.y))
# Rotation (x, y, z, w)
- # Blender provides (w, x, y, z)
+ # Blender provides (w, x, y, z), so reorder to (x, y, z, w)
f.write(struct.pack('<4f', rot.x, rot.y, rot.z, rot.w))
# Scale