Assignment 1: Rendering Basics with PyTorch3D

[Shobhit Arora] · [shobhit2]
16-825: Learning for 3D Vision

1. Practicing with Cameras

For the turntable animation, I changed the camera azimuth while keeping its distance and elevation fixed.

For the dolly zoom effect, we change the camera distance together with the field of view to keep the cow approximately the same size. Its an illusion.

2. Practicing with Meshes

Each square side of the cube is represented by two triangles, giving 12 triangular faces (2x6) in total.

3. Re-texturing a Mesh

Cow with a blue-to-red color gradient
Blue at the front, blending into red at the back (it will seem purple in the middle).

I chose blue, color1 = [0, 0, 1], and red, color2 = [1, 0, 0]. I used each vertex's z-coordinate to interpolate between the colors.

alpha = (z - z_min) / (z_max - z_min)
color = (1 - alpha) * color1 + alpha * color2

4. Camera Transformations

I changed the camera extrinsics using the relative rotation and translation from the starter code:

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

Target 1

The relative rotation changes the cow's orientation in the image by 90 degrees clockwise, around the viewing axis.

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

Target 2

I kept the rotation unchanged and increased the cow's depth in camera coordinates. This makes it appear smaller.

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

Target 3

The rotation is kept unchanged and I just adjusted the x and y translation. In PyTorch3D camera coordinates, positive x points left and positive y points up. A positive x translation and negative y translation move the cow toward the lower left of the image.

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

Target 4

I used a rotation about the y-axis to obtain a side view. Because the starter code also rotates the original translation, I added a relative translation to bring the cow back in front of the camera (tried multiple values here).

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

T_relative = [-3, 0, 3]

5. Rendering Generic 3D Representations

5.1 Point Clouds from RGB-D Images

5.2 Parametric Surfaces

5.3 Implicit Surfaces

Mesh vs. Point Cloud

6. Creative Rendering: Re-texturing a Football

Rotating football with blue-to-white-to-blue coloring
                and black panels
Blue → white → blue, with the black panels preserved from the football mesh.

I downloaded a football mesh and used its material labels to distinguish the white panels from the black panels. I recolored the white panels while keeping the black panels black.

I used blue [0.1, 0.3, 0.9] and white [1.0, 1.0, 1.0]. I calculated each triangle's center and normalized its z-coordinate. The blend is strongest at the middle of the ball, creating a white band that fades into blue toward both ends.

7. Sampling Points on Meshes

Sampled points from the cow's surface by first selecting triangles with probability proportional to their area. For each selected triangle, I generated a uniformly distributed point using barycentric coordinates.

area = 0.5 * ||(B - A) × (C - A)||
probability = area / total_area

point = (1 - u - v) * A + u * B + v * C

I sampled each point cloud once before rotating the camera, so the points remain fixed during the animation. Increasing the sample count gives more coverage of the surface and makes the cow's shape easier to recognize and pixels more dense.