16-825 Assignment 1

Andrew ID: pinwenw

1. Practicing with Cameras (15 pts)

1.1 360-Degree Renders (5 pts)

A full turntable around the cow mesh, generated by sweeping 36 equally-spaced azimuth angles through look_at_view_transform. The point light is re-located to the camera's position on every frame so the cow is never backlit.

360° turntable of the cow mesh

1.2 Re-creating the Dolly Zoom (10 pts)

The camera distance and field of view are swept together so the cow keeps a constant apparent width in frame: for a fixed real-world width w, distance = (w/2) / tan(fov/2). As the FOV narrows the camera pulls back, producing the classic vertigo/dolly-zoom effect where the background appears to compress relative to the subject.

Dolly zoom (FOV sweeps 5° → 120°)

2. Practicing with Meshes (10 pts)

2.1 Constructing a Tetrahedron (5 pts)

Vertices and faces defined by hand. 4 vertices, 4 triangular faces.

360° turntable of the tetrahedron

2.2 Constructing a Cube (5 pts)

An axis-aligned cube built from 8 vertices with two triangles per face. 8 vertices, 12 triangular faces.

360° turntable of the cube

3. Re-texturing a Mesh (10 pts)

The cow is recolored with a per-vertex gradient based on z-coordinate: color1 = (0, 0, 1) (blue) at the front (z_min) and color2 = (1, 0, 0) (red) at the back (z_max), linearly interpolated by alpha = (z - z_min) / (z_max - z_min).

Cow re-textured blue (front) → red (back)

4. Camera Transformations (10 pts)

For each target view, the new camera extrinsics are R = R_relative @ R_0 and T = R_relative @ T_0 + T_relative, where R_0 = I and T_0 = (0, 0, 3).

1. A 90° rotation about the camera's own viewing (z) axis — a pure roll. Rotating about the viewing axis doesn't move the camera or change what it looks at, so no translation correction is needed (T_relative = 0).
2. The camera orbits 90° around the vertical (y) axis to view the cow's side profile. Because R and T update with different multiplication conventions (R_relative @ R_0 vs. R_relative @ T_0), simply rotating no longer keeps the camera aimed at the cow — T_relative = (-3, 0, 3) supplies the correction needed to re-center it.
3. No rotation; the camera is dollied straight back along +z (T_relative = (0, 0, 2)), shrinking the cow in frame.
4. No rotation; the camera is shifted sideways and down (T_relative = (0.5, -0.5, 0)), moving the cow toward the lower-left of frame.

5. Rendering Generic 3D Representations (45 pts)

5.1 Rendering Point Clouds from RGB-D Images (10 pts)

Two RGB-D views of a plant are unprojected into 3D point clouds using the camera intrinsics/extrinsics, then merged into a third, unioned point cloud. Each single view has holes from occlusion and missing depth; the union fills most of them in.

Left to right: view 1, view 2, union of both

5.2 Parametric Functions (10 + 5 pts)

Torus (required): sampled directly from its parametric equations — x=(R+r cosφ)cosθ, y=(R+r cosφ)sinθ, z=r sinφ — and colored by the tube angle φ so the hole and the tube's circular cross-section are both clearly visible while it spins.

Extra credit — Möbius strip: parameterized by a loop angle u and a width coordinate v (x=(1+½v cos(u/2))cos u, etc.), colored across its width so the half-twist that makes it one-sided is visible as the color pattern flips.

Torus point cloud
Extra credit: Möbius strip point cloud

5.3 Implicit Surfaces (15 + 5 + 5 pts)

Torus (required): defined as the zero level-set of F(x,y,z) = (√(x²+y²) - R)² + z² - r², evaluated on a voxel grid and converted to a mesh with marching cubes.

Torus mesh (implicit surface)
Extra credit: gyroid mesh (implicit surface)

Extra credit: a gyroid — a triply-periodic minimal surface defined by F(x,y,z) = sin x cos y + sin y cos z + sin z cos x — extracted the same way over a region spanning a few periods.

Mesh vs. point cloud — discussion (5 pts):

  • Rendering quality. The mesh gives a continuous, correctly-lit surface because marching cubes produces real triangles with well-defined normals for Phong shading. The point cloud has no true surface between points, so at grazing angles or low sample density it shows visible gaps; it only looks solid once enough points are splatted to overlap on screen.
  • Ease of generation. For a parametric surface, the point cloud is trivial — just evaluate the equations on a grid of parameters. The implicit mesh needs an extra step (marching cubes) that requires choosing a voxel resolution and a bounding region up front, and fine features (like a thin torus tube) can be missed entirely if the grid is too coarse.
  • Memory. Marching cubes needs a full 3D voxel buffer in memory during extraction — O(voxel_size³) — even though the resulting mesh itself is compact. A point cloud only ever stores O(N) points directly, with no volumetric intermediate.
  • Rendering speed. Point rasterization is cheap per point but you typically need many more points than mesh vertices to avoid visible gaps at a given resolution. Mesh rasterization does more per-primitive work (barycentric interpolation, shading) but each triangle covers many pixels, so it scales well once the mesh is built — the real cost for meshes is the one-time marching cubes extraction, not the rendering itself.
  • Robustness / topology. Marching cubes can produce non-manifold or broken topology if the voxel grid under-resolves the surface (this implementation smooths the voxel grid first to keep the torus watertight). Point sampling from a parametric equation is always geometrically exact wherever a closed-form parametrization exists, but implicit surfaces with no such parametrization have no direct point-cloud equivalent at all — marching cubes is required.