Spaces:
Running
on
Zero
Running
on
Zero
Update trellis/utils/postprocessing_utils.py
Browse files
trellis/utils/postprocessing_utils.py
CHANGED
|
@@ -455,4 +455,10 @@ def to_glb(
|
|
| 455 |
# rotate mesh (from z-up to y-up)
|
| 456 |
vertices = vertices @ np.array([[1, 0, 0], [0, 0, -1], [0, 1, 0]])
|
| 457 |
mesh = trimesh.Trimesh(vertices, faces, visual=trimesh.visual.TextureVisuals(uv=uvs, image=texture))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 458 |
return mesh
|
|
|
|
| 455 |
# rotate mesh (from z-up to y-up)
|
| 456 |
vertices = vertices @ np.array([[1, 0, 0], [0, 0, -1], [0, 1, 0]])
|
| 457 |
mesh = trimesh.Trimesh(vertices, faces, visual=trimesh.visual.TextureVisuals(uv=uvs, image=texture))
|
| 458 |
+
|
| 459 |
+
# rotate mesh with 90 degrees around y-axis
|
| 460 |
+
angle = np.radians(90)
|
| 461 |
+
direction = [0, 1, 0]
|
| 462 |
+
rot_matrix = trimesh.transformations.rotation_matrix(angle, direction)
|
| 463 |
+
mesh.apply_transform(rot_matrix)
|
| 464 |
return mesh
|