Assignment 1

1.1 Practicing with Cameras

1.1 360-degree Renders

Cow render

1.2 Re-creating the Dolly Zoom

Dolly Zoom

2. Practicing with Meshes

2.1 Constructing a Tetrahedron

Mesh has 4 vertices and 4 triangle faces

2.2 Constructing a Cube

Mesh has 8 vertices and 12 triangle faces

3. Re-texturing a mesh

Picked a purple and a pink (my favorite colors) to transition between

Color1 = [0.7, 0.7, 1.0] Color2 = [1.0, 0.0, 0.7]

4. Camera Transformations

Horizontal Cow

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


To transform the cow to be horizontal, the camera needs to be rotated along the z axis. When we do that, the R matrix needs to account for the change in the x and y axes. No translation is needed, so the T matrix remains 0.

Zoomed out Cow

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


To zoom out slightly, the rotation matrix remains the same as the camera is not being rotated. The camera is moved by 1 point away from the object.

Slightly Transposed Cow

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


To view the cow from a slightly different angle and to match the expected image, the camera is moved slightly to the right and elevated by 0.5. Rotating the camera is not necessary.

Sideways Cow

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


To view the cow sideways, the camera is transposed to the side of the cow first, moving the x and z axes. Then, it is rotated by 90 degrees to look at the cow, the x and z axes are changed to do that. ## 5. Rendering Generic 3D Representations ### 5.1 Rendering Point Clouds from RGB-D Images

View 1

View 2

Union of View 1 and View 2

5.2 Parametric Functions


Torus with 50 samples

Torus with 200 samples

Random object with 200 samples

Random object with 500 samples

Function for the random object

phi = torch.linspace(0, 2 * np.pi, num_samples) theta = torch.linspace(0, np.pi, num_samples) phi, theta = torch.meshgrid(phi, theta) x = torch.sin(theta) * torch.cos(phi) + 2 * torch.sin(2 * phi) y = torch.sin(theta) * torch.sin(phi) + 2 * torch.cos(2 * phi) z = torch.cos(theta)

In addition, discuss some of the tradeoffs between rendering as a mesh vs a point cloud. Things to consider might include rendering speed, rendering quality, ease of use, memory usage, etc.

Meshes represent the surface using vertices connected by faces, which provide a continuous, well-defined surface. Because of this, they generally can produce higher-quality and closed renderings. However, they need to store the connectivity information between vertices which increases their complexity and memory usage. Additionally, modifying meshes is not as easy.

Point clouds store positions of individual points, which makes them easier to create and manipulate. However, if the number of sampled points is too less, they can appear to have holes and cannot be used to define explicit edges of the object. Increasing the number of points improves the appearance, but also increases memory usage and rendering time.

In terms of rendering speed, point clouds are faster for a smaller number of points. Meshes are preferred when a continuous surface is needed with well defined edges. Point clouds are easier to modify. Overall, meshes provide better surface quality and can be textured, colored a lot easier. However, point clouds are more simple and flexible, with lower memory usage, and also lower quality.

5.3 Implicit Surfaces


Torus with implicit function

New object (heart) with implicit function
Function for the heart
voxels = (X**2+ 9/4 * Z**2 + Y**2 - 1)**3 - X**2 * Y**3 - 9/200 * Z**2 * Y**3

6. (Extra Credit) Do Something Fun


Made a cat (defined all the vertices, faces and the colors). 28 vertices, 37 faces.

7. (Extra Credit) Sampling Points on Meshes


Cow pointcloud with 10 points

Cow pointcloud with 100 points

Cow pointcloud with 1000 points

Cow pointcloud with 10000 points

Original cow mesh