Fix rotation: start at 330° (3rd UNLOCKED view), fixed 20° pitch, r=2 fov=36
Browse files
trellis2/utils/render_utils.py
CHANGED
|
@@ -77,9 +77,15 @@ def render_frames(sample, extrinsics, intrinsics, options={}, verbose=True, **kw
|
|
| 77 |
return rets
|
| 78 |
|
| 79 |
|
| 80 |
-
def render_video(sample, resolution=1024, bg_color=(0, 0, 0), num_frames=120, r=2, fov=
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
yaws = yaws.tolist()
|
| 84 |
pitch = pitch.tolist()
|
| 85 |
extrinsics, intrinsics = yaw_pitch_r_fov_to_extrinsics_intrinsics(yaws, pitch, r, fov)
|
|
|
|
| 77 |
return rets
|
| 78 |
|
| 79 |
|
| 80 |
+
def render_video(sample, resolution=1024, bg_color=(0, 0, 0), num_frames=120, r=2, fov=36, **kwargs):
|
| 81 |
+
# Match UNLOCKED render_snapshot exactly:
|
| 82 |
+
# - offset = (5π/6, 20°) means views at 150°, 240°, 330°, 60°
|
| 83 |
+
# - 3rd view is 330° = start point for video
|
| 84 |
+
# - Pitch = 20 degrees (fixed)
|
| 85 |
+
start_yaw = 330 / 180 * np.pi # 3rd view from UNLOCKED (330 degrees)
|
| 86 |
+
pitch_val = 20 / 180 * np.pi # Fixed pitch from UNLOCKED offset
|
| 87 |
+
yaws = torch.linspace(start_yaw, 2 * np.pi + start_yaw, num_frames)
|
| 88 |
+
pitch = torch.tensor([pitch_val] * num_frames)
|
| 89 |
yaws = yaws.tolist()
|
| 90 |
pitch = pitch.tolist()
|
| 91 |
extrinsics, intrinsics = yaw_pitch_r_fov_to_extrinsics_intrinsics(yaws, pitch, r, fov)
|