depth, normals i guess

This commit is contained in:
2026-02-19 22:06:21 +02:00
parent 4dd2e13c48
commit 04b0f02e7f
18 changed files with 129 additions and 55 deletions

View File

@@ -42,21 +42,20 @@ def export_my_format(filepath):
for loop_index in tri.loops:
vert = mesh.vertices[mesh.loops[loop_index].vertex_index]
world_pos = obj.matrix_world @ vert.co
print(world_pos.x)
world_normal = obj.matrix_world @ vert.normal
f.write(struct.pack('f', world_pos.x))
print(world_pos.y)
f.write(struct.pack('f', world_pos.y))
print(world_pos.z)
f.write(struct.pack('f', world_pos.z))
if uv_layer:
uv = uv_layer[loop_index].uv
print(uv.x)
f.write(struct.pack('f', uv.x))
print(uv.y)
f.write(struct.pack('f', uv.y))
else:
f.write(struct.pack('f', 0))
f.write(struct.pack('f', 0))
f.write(struct.pack('f', world_normal.x))
f.write(struct.pack('f', world_normal.y))
f.write(struct.pack('f', world_normal.z))
return {'FINISHED'}

BIN
tools/cube.fmesh_c Normal file

Binary file not shown.