16-825: Learning for 3D Vision

Assignment 1

Fall 2026

Rendering Basics with PyTorch3D

Contents

Results

1.1. 360-degree Renders

5 points

A turntable of the cow mesh, rendered from 36 equally spaced azimuths at a distance of 2.5 and an elevation of 20°.

Cow mesh · 360° turntable
Cow mesh · 360° turntable

1.2. Re-creating the Dolly Zoom

10 points

The field of view increases while the camera moves closer to the cow. Keeping distance × tan(fov / 2) constant approximately preserves the subject’s size while changing the perspective of the ground plane.

Dolly zoom with changing field of view
Dolly zoom with changing field of view

2.1. Constructing a Tetrahedron

5 points

The tetrahedron has 4 vertices and 4 triangular faces. Its vertices and face indices are defined manually.

Tetrahedron · 360° turntable
Tetrahedron · 360° turntable

2.2. Constructing a Cube

5 points

The cube has 8 vertices and 12 triangular faces. Each of the six square sides is split into two triangles.

Cube · 360° turntable
Cube · 360° turntable

3. Re-texturing a Mesh

10 points

I chose red, color1 = [1, 0, 0], at the front (minimum z), and blue, color2 = [0, 0, 1], at the back (maximum z). Linear interpolation produces a smooth transition through purple.

alpha = (z - z_min) / (z_max - z_min)
color = (1 - alpha) * color1 + alpha * color2
Cow with a red-to-blue vertex color gradient
Cow with a red-to-blue vertex color gradient

4. Camera Transformations

10 points

The base extrinsics are R_0 = I and T_0 = [0, 0, 3]. Each result uses the composition below.

R = R_relative @ R_0
T = R_relative @ T_0 + T_relative

Transform 1

Camera transformation 1
Camera transformation 1

Rotate the projected cow by 90° counterclockwise in the image plane. The z-axis depth is unchanged, so no translation is needed.

R_relative = [[0, 1, 0], [-1, 0, 0], [0, 0, 1]]
T_relative = [0, 0, 0]

Transform 3

Camera transformation 3
Camera transformation 3

Keep the orientation fixed and increase the view-space depth from 3 to 5. The cow appears smaller and stays centered.

R_relative = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
T_relative = [0, 0, 2]

Transform 2

Camera transformation 2
Camera transformation 2

Rotate about the y-axis to show another side of the cow. The translation compensates for the rotated initial translation: R_relative @ T_0 = [3, 0, 0], giving a final T = [0, 0, 3].

R_relative = [[0, 0, 1], [0, 1, 0], [-1, 0, 0]]
T_relative = [-3, 0, 3]

Transform 4

Camera transformation 4
Camera transformation 4

Keep the orientation and depth fixed. Positive view-space x moves the cow left in the image, and negative y moves it down.

R_relative = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
T_relative = [0.5, -0.5, 0]

5.1. Rendering Point Clouds from RGB-D Images

10 points

Each masked RGB-D image is unprojected into world-space points with its camera parameters. The third cloud concatenates both sets of points and colors. All three are rendered from the same rotating camera, making the complementary visible surfaces easy to compare.

Image 1 point cloudImage 2 point cloudUnion of both
Left to right: first RGB-D point cloud, second RGB-D point cloud, and their union · synchronized 360° views
Left to right: first RGB-D point cloud, second RGB-D point cloud, and their union · synchronized 360° views

5.2. Parametric Functions

10 + 5 points

Torus point cloud

A torus sampled with major radius R = 3 and minor radius r = 1. The rotating views reveal its central hole.

Parametric torus point cloud · 360° turntable
Parametric torus point cloud · 360° turntable
x = (R + r cos θ) cos φ
y = (R + r cos θ) sin φ
z = r sin θ
θ, φ ∈ [0, 2π]

Additional object: twisted torus

An elliptical cross-section with semi-axes 0.6 and 0.25 twists three times around a ring of radius 2. Colors are derived from normalized point coordinates.

Twisted elliptical torus point cloud · 360° turntable
Twisted elliptical torus point cloud · 360° turntable

5.3. Implicit Surfaces

15 + 5 points

Implicit torus mesh

I evaluate the torus field on a 64³ voxel grid, smooth it, and extract the zero level set with marching cubes. R = 3 and r = 1.

Implicit torus mesh · 360° turntable
Implicit torus mesh · 360° turntable
F = (x² + y² + z² + R² - r²)²
    - 4R²(x² + y²) = 0

Additional object: heart

A heart-shaped implicit surface is converted into a triangle mesh using the same extraction procedure.

Implicit heart mesh · 360° turntable
Implicit heart mesh · 360° turntable
F = (x² + 9z²/4 + y² - 1)³
    - x²y³ - 9z²y³/80 = 0

Mesh vs. point cloud

The measurements in tradeoffs.log compare 30 views at an image resolution of 256 × 256. The mesh uses a voxel grid resolution of 64³.

Measured metricMeshPoint cloud
Render time (30 views)40.5208 s292.1637 s
Peak memory reported by tracemalloc0.05 MB0.03 MB

In this run, the point cloud took approximately 7.21× as long to render as the mesh. This supports using a mesh for efficient rendering of this continuous surface, although the result depends on sampling density, rendering settings, and hardware. The recorded render time excludes implicit field evaluation and marching cubes mesh extraction.

The logged memory peak is slightly higher for the mesh. However, the code uses tracemalloc, which tracks Python allocations rather than total PyTorch tensor or GPU memory, and starts tracking after the geometry is constructed. These values therefore do not establish which representation uses less total memory.

Practical tradeoffs

AspectMeshPoint cloud
Rendering speedTriangle rasterization efficiently covers continuous surfaces, but extracting an implicit mesh adds preprocessing.Avoids mesh extraction. Dense clouds and overlapping point splats can make rendering expensive; speed depends on point count, radius, resolution, and hardware.
Rendering qualityConnected faces provide continuous coverage and surface normals for lighting. A coarse voxel grid can lose detail.Sparse sampling can leave gaps. Larger splats fill holes but may blur silhouettes; denser sampling improves coverage.
Ease of useRequires valid connectivity or a surface extraction step. Convenient for shading and continuous surface rendering.Directly represents RGB-D measurements and parametric samples; combining clouds only requires concatenating points and features.
MemoryStores vertices, face indices, and attributes. Implicit extraction also needs a temporary voxel grid whose size grows cubically with resolution.Stores positions and features without face indices, but matching a smooth mesh’s coverage may require many more points.

6. Do Something Fun

Extra credit · 10 points

I animate a red intensity wave across the implicit heart while the camera orbits it. The geometry remains fixed, while vertex colors vary with height and time, producing a moving band of light and dark red.

phase = 2π * frame / num_frames
red = 0.5 + 0.5 * sin(3 * y + phase)
color = [red, 0, 0]
Heart with an animated red color wave
Heart with an animated red color wave

7. Sampling Points on Meshes

Extra credit · 10 points

Faces are sampled with probability proportional to their area. Within each selected triangle, independent uniform samples u and v produce the barycentric weights below, yielding uniform sampling over the mesh surface.

w0 = 1 - sqrt(u)
w1 = sqrt(u) * (1 - v)
w2 = sqrt(u) * v
point = w0 * v0 + w1 * v1 + w2 * v2

Increasing the sample count makes the cow’s silhouette and surface more complete. The original mesh and all four point clouds are rendered from matching viewpoints.

Original mesh10 points100 points1,000 points10,000 points
Original cow mesh and 10, 100, 1,000, and 10,000 sampled points · synchronized turntables
Original cow mesh and 10, 100, 1,000, and 10,000 sampled points · synchronized turntables