Assignment 1: Rendering Basics¶

Generate every result with python main.py. Outputs are saved under results/.

1. Cameras¶

Cow turntable

Dolly zoom

For a subject at the origin, its projected scale is proportional to 1 / (d tan(fov / 2)). I keep d tan(fov / 2) equal to 3 tan(30 degrees) as the field of view changes from 5 to 120 degrees. The background changes scale relative to the subject.

2. Meshes¶

The tetrahedron has 4 vertices and 4 triangular faces.

Tetrahedron

The cube has 8 vertices and 12 triangular faces: two triangles per square face. Both meshes use outward-facing triangle winding.

Cube

3. Retexturing¶

The front color is color1 = [0.1, 0.3, 1.0] and the back color is color2 = [1.0, 0.3, 0.1]. Each vertex receives (1-alpha) color1 + alpha color2, where alpha = (z-z_min)/(z_max-z_min).

Retextured cow

4. Camera transformations¶

I compose the extrinsics in the column-vector convention specified in the prompt: R = R_relative R_0, T = R_relative T_0 + T_relative. PyTorch3D transforms row vectors, so I pass the transpose of this rotation to its camera.

  1. Rotate 90 degrees about the optical z axis, with zero relative translation.
  2. Keep the rotation unchanged and add [0, 0, 3], increasing camera depth from 3 to 6.
  3. Keep the rotation unchanged and add [0.5, -0.5, 0], shifting the cow left and down in the image.
  4. Rotate -90 degrees about y and add [3, 0, 3]. The translation compensates for rotating the original translation, leaving final translation [0, 0, 3].

Roll Distance Shift Side view

5. Generic representations¶

RGB-D point clouds¶

Unproject each masked depth image into world coordinates using its supplied camera. Concatenate the world-space points and their colors to form the union. All three panels use the same camera trajectory, with a 180-degree camera roll to orient the plant upright. The RGB-D comparison uses 12 viewpoints at 128 pixels per panel; other turntables use 60 viewpoints at 256 pixels. Every valid depth point is retained. Reproduce this comparison with python main.py --q 5.1 --image_size 128 --num_frames 12.

First view, second view, union

Parametric surfaces¶

The torus uses major radius 1 and minor radius 0.35: ((1+0.35 cos(v)) cos(u), 0.35 sin(v), (1+0.35 cos(v)) sin(u)). The additional object is a Mobius strip with width parameter in [-0.35, 0.35]. Colors are normalized coordinates. Elevated views reveal the torus hole.

Parametric torus Mobius strip

Implicit surfaces¶

The torus is the zero level set of (sqrt(x*x+z*z)-1)^2 + y*y - 0.35^2. The additional object is an ellipsoid with radii (0.8, 1.25, 1.0). Marching cubes extracts each zero level set on a 64-cubed grid over [-1.6, 1.6]^3. Grid vertex coordinates are converted to world coordinates using spacing 3.2/(64-1).

Implicit torus Ellipsoid

Meshes give continuous surfaces, interpolated colors, and normals for lighting. Point clouds are easy to obtain directly from depth images and do not require connectivity, but can show holes or visible splats when samples are sparse. Increasing point density and splat radius improves coverage but increases storage and rasterization work. Meshes also require face connectivity; their memory and rendering cost depend on both vertex and face counts. Marching cubes adds a preprocessing cost and a dense voxel grid, whose memory grows cubically with resolution. Rendering speed depends on resolution, geometry size, and rasterizer settings; no timing comparison has been measured here.

6. Creative scene¶

Three colored tori intersect at perpendicular orientations, forming a spherical ring sculpture.

Ring sculpture

7. Sampling mesh surfaces¶

Select triangles with probability proportional to their area. For independent uniform u,v, use barycentric weights (1-sqrt(u), sqrt(u)(1-v), sqrt(u)v). This samples the triangle surface uniformly. Vertex colors are interpolated with the same weights. The panels show the original mesh and 10, 100, 1000, and 10000 sampled points.

Surface sampling comparison