16-825 Assignment 1 — Rendering Basics with PyTorch3D

Minghao Xu

1. Practicing with Cameras

1.1 — Cow 360° turntable
1.1 360° cow turntable (GIF).
1.2 — Dolly Zoom effect
1.2 Dolly Zoom effect (GIF).

2. Practicing with Meshes

2.1 — Tetrahedron 360°
2.1 Tetrahedron — 360° GIF. (4 verts / 4 faces)
2.2 — Cube 360°
2.2 Cube — 360° GIF. (8 verts / 12 tri faces)

3. Re-texturing a Mesh

3 — Cow front→back color gradient
3.1 Cow front→back gradient (GIF).

Color mapping (swapped): front (z_min) uses color2, back (z_max) uses color1.

4. Camera Transformations

New extrinsics are formed as R = R_relative @ R_0, T = R_relative @ T_0 + T_relative. R_relative rotates the original camera frame (yaw/pitch/roll); T_relative then translates the camera in that rotated frame (dolly/slide) to keep framing sensible.

4.0 — Base camera view
4.0 Base view (Rrel=I, Trel=0).
4.1 — Roll clockwise 90°
4.1 Roll clockwise 90°.
4.2 — Dolly out
4.2 Dolly out (translate farther along view direction).
4.3 — Yaw left 10°
4.3 Yaw left 10°.
4.4 — Right-side view
4.4 Right-side view (rotate + translate to reframe).
Chosen R_relative / T_relative (values)
# Base
R_rel = I_3
T_rel = [0, 0, 0]

# 4.1 Roll clockwise 90° about +Z
R_rel = [[ 0,  1, 0],
         [-1,  0, 0],
         [ 0,  0, 1]]
T_rel = [0, 0, 0]

# 4.2 Dolly out (farther)
R_rel = I_3
T_rel = [0, 0, +2.0]

# 4.3 Yaw left 10° about +Y
# c = cos(10°), s = sin(10°)
R_rel = [[  c, 0,  s],
         [  0, 1,  0],
         [ -s, 0,  c]]
T_rel = [0, 0, 0]

# 4.4 Right-side view (quarter turn right) + reframe
R_rel = [[0, 0, 1],
         [0, 1, 0],
         [-1,0, 0]]
T_rel = [-3, 0, 3]

5. Generic 3D Representations

5.1 RGB-D → Point Clouds

5.1 — Plant point clouds side-by-side
5.1 View1 / View2 / Union — side-by-side 360° GIF.

5.2 Parametric Functions

5.2 — Torus still
Torus (still) — parametric point cloud.
5.2 — Torus 360° GIF
Torus (360° GIF) — hole visible.
5.2 extra — Vase surface of revolution
Extra — surface of revolution (vase) 360° GIF.

5.3 Implicit Surfaces

5.3 — Torus mesh still
Torus mesh (still) — implicit → marching cubes.
5.3 — Torus mesh 360° GIF
Torus mesh (360° GIF) — hole visible.
5.3 — Heart mesh still
New object — heart mesh (still).
5.3 — Heart mesh 360° GIF
New object — heart mesh (360° GIF).

Discussion (5.1–5.3)

RGB-D unprojection: For pixel (u,v) with depth d and intrinsics (fx,fy,cx,cy): X=((u-c_x)/f_x)·d, Y=((v-c_y)/f_y)·d, Z=d; convert via extrinsics to world. Concatenating two views (union) densifies coverage and fills occlusions.

Parametric torus: x=(R+r\cos v)\cos u, y=r\sin v, z=(R+r\cos v)\sin u. Tilt camera (e.g., elev≈30°) so the hole is visible; procedural color for “chocolate glaze”.

Implicit torus mesh: Evaluate F(x,y,z)=(\sqrt{x^2+z^2}-R)^2 + y^2 - r^2 on a voxel grid and extract the 0-level via marching cubes. Higher voxel resolution → smoother mesh but more time/memory.

Point cloud vs. mesh: Points render fast and are easy to generate; silhouettes can look fuzzy unless point radius is tuned. Meshes give crisp silhouettes and standard shading; require topology; performance scales with face count.

6. Do Something Fun

6 — Soccer ball 360° GIF
Soccer ball — truncated icosahedron mapped to a smooth sphere (360° GIF).

7. Extra Credit — Sampling Points on Meshes

7 — Cow surface sampling at 10/100/1k/10k
Area-weighted stratified sampling — cow at 10 / 100 / 1k / 10k points (with mesh).