Keeping the cow the same width in frame requires
where 1.732 = 3 · tan(30°) comes from the starter setup (fov = 60°,
distance = 3). I also set znear = 0.01, since the default of 1.0
clips through the cow once the camera closes in at wide fov.
4 vertices and 4 triangular faces. Each face uses three of the four vertices, so the face list is the four ways of omitting one.
8 vertices and 12 triangular faces, since each of the 6 square sides splits into 2 triangles.
I chose color1 = [0, 0, 1] (blue) for the front of the cow and color2 = [1, 0, 0] (red) for the back. Each vertex colour is interpolated by its z coordinate:
Each view uses R = R_relative @ R_0 and T = R_relative @ T_0 + T_relative, with R_0 = I and T_0 = [0, 0, 3].
| View | R_relative | T_relative | What it does |
|---|---|---|---|
| 1 | rotate -90° about z | [0, 0, 0] | Rolls the camera about its own viewing axis. T_0 lies on that axis and is unchanged, so no translation is needed. |
| 2 | rotate +90° about y | [-3, 0, 3] | Swings the camera to the side of the cow. The rotation also carries T_0 to [3, 0, 0], putting the cow out of frame, so T_relative moves it back to [0, 0, 3] in front of the camera. |
| 3 | identity | [0, 0, 2] | Moves the camera 2 units further back, so the cow appears smaller. |
| 4 | identity | [0.5, -0.5, 0] | Translates the camera within the image plane, shifting the cow toward the lower right at unchanged size. |
Both views are unprojected into world coordinates, so the union is a plain concatenation of the two point and colour tensors.
R = 1.0, r = 0.4, with θ and φ each sampled 200 times over [0, 2π]. y and z are swapped from the textbook form so the hole lies along the y-up axis of PyTorch3D.
New object: a helix tube, obtained by letting the height rise linearly with φ and letting φ wrap three times.
F is evaluated on a 128³ voxel grid spanning -1.5 to 1.5, and marching cubes extracts the zero level set, giving 41,024 vertices and 82,048 triangles.
Measured at 256 × 256 on CPU, mean of five renders after a warm-up (three for the plant). Memory counts coordinates and colour as float32 and face indices as int64.
| Object | Representation | Primitives | Time / frame | Memory |
|---|---|---|---|---|
| Torus, marching cubes | mesh | 82,048 triangles | 4.14 s | 2,884 KB |
| Torus, parametric | point cloud | 40,000 points | 3.29 s | 938 KB |
| Torus, parametric, triangulated | mesh | 4,096 triangles | 0.20 s | 144 KB |
| Cow | mesh | 5,856 triangles | 0.29 s | 206 KB |
| Plant, both views merged | point cloud | 248,784 points | 21.65 s | 6,803 KB |
Speed. Meshes are not simply faster. The marching cubes torus is slower than the point cloud of the same shape, because cost tracks primitive count rather than representation. The advantage of a mesh is that it can cover a surface with far fewer primitives: triangulating the same torus from its parametric function needs 4,096 triangles and renders 20 times faster at equal quality. Marching cubes forfeits that advantage by emitting uniform triangle density regardless of curvature.
Quality. Point clouds leave gaps between samples and carry no normals, so there is no real shading and colour must be baked in per point. A mesh has connectivity, so normals follow from the faces and Phong shading works, which is why the 5.3 torus reads as solid while the 5.2 torus looks flat.
Memory. Per element a mesh costs more, entirely because of the face list. At equal visual quality that reverses: 144 KB for the triangulated torus against 938 KB for the point cloud. Extracting a mesh from an implicit function adds a further cost, since 2,097,152 voxel evaluations yield only 41,024 vertices, discarding about 98 percent of the work.
Ease of use. Point clouds are what depth sensors output directly, and 5.1 built one with no topology decisions at all. Meshes need a valid triangulation, and recovering one from points normally requires fitting an implicit function first, but meshes are what texturing, editing and animation tools expect.
Two sphere distance functions combined by boolean union, F = min(f1, f2).
The spheres have radius 0.7 with centres 1.0 apart, so marching cubes produces one
connected surface with a neck. A parametric surface cannot merge shapes this way,
because its topology is fixed by the parameter domain.
Procedural stripes whose phase advances every frame, so the pattern flows along the cow as the camera orbits.
A face is drawn with probability proportional to its area, then a barycentric coordinate is sampled with the square root correction that keeps points uniform rather than clustered toward the centre:
The point is then α1·p1 + α2·p2 + α3·p3.