Assignment 1: Rendering Basics with PyTorch3D

16-825 Learning for 3D Vision · Shubh Jain · shubhj@andrew.cmu.edu

1.1 360-degree Renders

360-degree turntable render of the cow mesh

1.2 Re-creating the Dolly Zoom

Dolly zoom effect on the cow

2.1 Constructing a Tetrahedron

360-degree turntable render of a tetrahedron

The mesh has 4 vertices and 4 triangle faces.

2.2 Constructing a Cube

360-degree turntable render of a cube

The mesh has 8 vertices and 12 triangle faces (6 square faces, each split into 2 triangles).

3. Re-texturing a Mesh

Cow with a blue-to-red vertex gradient

color1 = [0, 0, 1] (blue) at the front of the cow and color2 = [1, 0, 0] (red) at the back. They share no colour channel, so the gradient passes through a clearly visible purple midpoint.

4. Camera Transformations

4.1

Cow rotated 90 degrees in the image plane

R_relative rolls the camera 90° about its own optical axis, rotating the image clockwise. T_relative is zero: the camera does not move, so the cow stays the same size and distance.

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

4.2

Cow rendered smaller and centred

R_relative is the identity - the orientation is unchanged. T_relative pushes the camera backwards along its own viewing direction, from 3 to 5 units away, so the cow only gets smaller.

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

4.3

Cow shifted left and down in the frame

R_relative is the identity again. T_relative slides the camera within its own image plane, shifting the cow left and down in frame without changing its size or orientation.

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

4.4

Cow seen from the side

R_relative yaws the camera 90° about the vertical axis to look at the cow from its side. That rotation alone would swing the cow out of frame, so T_relative translates the camera around to the side as well, putting the cow back on the optical axis at the original distance.

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

5.1 Point Clouds from RGB-D Images

Point cloud from image 1, from image 2, and their union

Left: first image. Centre: second image. Right: the union of both.

5.2 Parametric Functions

360-degree turntable of a torus point cloud

Torus point cloud.

360-degree turntable of a trefoil knot point cloud

New object: trefoil knot.

5.3 Implicit Surfaces

360-degree turntable of a torus mesh from marching cubes

Torus mesh, extracted with marching cubes.

360-degree turntable of a five-pointed star mesh

New object: five-pointed star.

Tradeoffs: mesh vs. point cloud

Point cloudMesh
Memory Only positions and colours - no connectivity stored, so cheaper at equal vertex count. Vertices plus a face list. Marching cubes also produces far more vertices than a tuned parametric sampling would.
Rendering speed Cheap per primitive, but a convincing surface needs far more primitives. More expensive per primitive, but a coarse mesh already looks solid, so fewer are needed.
Quality No real surface - gaps appear when sampling is sparse or the camera is close, and you can see through the object. Splat radius must be tuned by hand. Watertight and correctly occluding. Supports normals, so it can be properly shaded and lit.
Ease of use Trivial to build: sample a function or unproject a depth map. The natural output of sensors. Needs connectivity. For an implicit function that means a voxel grid and an extraction step, adding a resolution parameter and grid artefacts on thin features.

6. Do Something Fun

A cow point cloud swirling into a torus and back

The cow mesh is sampled into a 40,000-point cloud and morphed into a parametric torus and back, with a twist that peaks mid-transition. Points are paired by azimuth so the swirl stays coherent, and each point keeps the colour of where it started on the cow.

7. Sampling Points on Meshes

Cow mesh beside point clouds of 10, 100, 1000 and 10000 sampled points

Left to right: original mesh, then 10, 100, 1,000 and 10,000 sampled points.