16-825 Assignment 1: Rendering Basics with PyTorch3D (Total: 90 Base Points + 20 Extra Credit)

Name: Xinyi Li Andrew ID: xinyil4

1. Practicing with Cameras

1.1 360-degree Renders

I render the cow from 60 equally spaced azimuth angles, with a 6-degree step between frames. And I use a near-black vertex color.

360-degree cow rendering

1.2 Dolly Zoom

I adjust the camera distance using:

distance = 3 × tan(60° / 2) / tan(fov / 2)

So the subject's size remains approximately stable, while the background perspective changes.

Dolly zoom

2. Practicing with Meshes

2.1 Tetrahedron

I set four triangular faces as:

(1, 1, 1)
(1, -1, -1)
(-1, 1, -1)
(-1, -1, 1)

Vertices: 4. Triangular faces: 4.

Tetrahedron

2.2 Cube

I set the eight corners of a cube using coordinates ±1.

Vertices: 8. Square faces: 6. Triangular faces: 12.

Cube

3. Re-texturing a Mesh

I use blue RGB (66, 176, 245) and yellow RGB (252, 248, 126), dividing each RGB value by 255.

alpha = (z - z_min) / (z_max - z_min)
color = alpha × blue + (1 - alpha) × yellow

Re-textured cow

4. Camera Transformations

The original camera parameters are R_0 = I and T_0 = [0, 0, 3]. I compute the new parameters using:

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

Original View

Original view

Transform 1: Image-plane Rotation

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

T_relative = [0, 0, 0]

This produces a clockwise 90-degree rotation in the image. The final translation remains [0, 0, 3].

Transform 1

Transform 2: Side View

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

T_relative = [-3, 0, 3]

The relative translation compensates for the rotated original translation, keeping the final T at [0, 0, 3].

Transform 2

Transform 3: Smaller Appearance

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

The final depth increases from 3 to 5.5.

Transform 3

Transform 4: Image Translation

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

No additional rotation is applied.

Transform 4

5. Rendering Generic 3D Representations

5.1 Point Clouds from RGB-D Images

Left to right: first point cloud, second point cloud, merged cloud.

RGB-D point clouds

5.2 Parametric Surfaces

Torus

x = (R + r cos(v)) cos(u)
y = r sin(v)
z = (R + r cos(v)) sin(u)

R = 1.0
r = 0.3

Parametric torus

Additional Object: Saddle

x = u
y = 0.6(u² - v²)
z = v

Parametric saddle

5.3 Implicit Surfaces

Torus

F(x, y, z) = (sqrt(x² + z²) - 1.0)² + y² - 0.3²

Implicit torus

Meshes vs. Point Clouds

Aspect Mesh Point cloud
Quality Connected triangles represent continuous surfaces and support surface shading. Sparse samples leave gaps; larger point radii improve coverage but may blur detail.
Use Requires connectivity or a surface extraction step. Can be constructed directly from RGB-D data or parametric samples.
Speed Depends on triangle count, resolution, and shading. Depends on point count, resolution, and point radius.

Additional Object: Ellipsoid

F(x, y, z) = (x / 0.8)² + (y / 1.2)² + (z / 0.6)² - 1

Implicit ellipsoid

6. Creative Scene: Ice Cream

Ice cream

7. Sampling Points on Meshes

area = 0.5 × ||(B - A) × (C - A)||
w_A = 1 - sqrt(u)
w_B = sqrt(u) × (1 - v)
w_C = sqrt(u) × v

point = w_A A + w_B B + w_C C

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

Mesh surface sampling