Everything here renders on CPU. I drive all of it from one script, run_all.py,
which writes the vertex counts, point counts and timings into output/facts.json as it
goes; this page reads that file, so the numbers below cannot drift away from the runs that produced
them.

The field of view sweeps 5°→120° while the camera distance follows
d = W / (2·tan(fov/2)), holding the frustum width W constant so the
cow stays the same size while the background rushes in.

A tetrahedron has 4 vertices and 4 triangular faces. Every face is already a triangle, so no subdivision is needed.

A cube has 8 vertices and 12 triangular faces: the 6 square faces are each split into 2 triangles.

Color is interpolated along the z axis with
alpha = (z - z_min)/(z_max - z_min), color = alpha·color2 + (1-alpha)·color1.
I chose color1 = [0.0, 0.05, 0.85] (deep blue, at the front / z_min) and
color2 = [1.0, 0.45, 0.0] (orange, at the back / z_max).

Instead of eyeballing which transform produces which target, I rendered every candidate against all four reference images and let the score decide. My first instrument was raw pixel MSE, and it does not work here. The four winning candidates score 0.03437 to 0.04195, but taking the 10 pairs of two different reference images and scoring those against each other gives 0.02698 to 0.09163. The floor of that range sits below my best match, so a pair of images with nothing in common can beat a correct answer. Almost all of the error is the lighting and shader difference between my renders and the provided jpgs, and it swamps the geometry.
Silhouette IoU ignores shading, so that is what the table below reports, and it needs the
reference masks cleaned first. Each reference jpg has a 2-pixel black frame: the region common to
all five reference masks is 2032 px, and 256² - 252² = 2032 exactly. Discarding all but the
largest connected component is not enough, because in transform4 the cow sits close
enough to the edge to touch the frame, and the two merge into a single component. That one merge
was worth 7 pixels of centroid error and would have made a correct answer look wrong. Dropping a
3-pixel margin removes the frame everywhere.
The control is the identity transform scored against transform_none, a pair correct
by construction. It reaches 0.9356, which is the ceiling, and the four
answers below land at 0.9306
and up. Each wins its reference by a margin of at least
0.486 IoU, and all four
land on different references, so the matching is a bijection rather than four independent guesses.

| 0 | 1 | 0 |
| -1 | 0 | 0 |
| 0 | 0 | 1 |
| 0 | 0 | 0 |
Pure rotation of the camera about its own optical (z) axis by 90 degrees. The camera stays where it is, so the cow is the same size and distance; only the image is turned on its side.
Matches transform1 · IoU 0.934 (100% of the control), ahead of the runner-up by 0.486

| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 0 | 0 | 1 |
| 0 | 0 | 2 |
Pure translation along the camera's viewing direction: the camera backs off by 2 units, so the cow keeps its pose but appears smaller.
Matches transform3 · IoU 0.932 (100% of the control), ahead of the runner-up by 0.717

| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 0 | 0 | 1 |
| 0.5 | -0.5 | 0 |
Pure translation in the image plane: the camera slides right and up, which shifts the cow left and down in frame without changing its size or pose.
Matches transform4 · IoU 0.931 (99% of the control), ahead of the runner-up by 0.767

| 0 | 0 | 1 |
| 0 | 1 | 0 |
| -1 | 0 | 0 |
| -3 | 0 | 3 |
The camera is moved a quarter turn around the cow and re-aimed at it, so we view the cow end-on. The rotation alone would swing the camera off target; the translation puts the cow back in the middle of the frame.
Matches transform2 · IoU 0.960 (103% of the control), ahead of the runner-up by 0.501
Left: first image. Middle: second image. Right: the union. Point counts: 125035, 123749, 248784.

Torus, sampled from
((R + r cosθ)cosφ, (R + r cosθ)sinφ, r sinθ) on a 200×200 grid.


Torus as the zero level set of
(√(x²+y²) - R)² + z² - r², evaluated on a
96³ voxel grid and meshed with marching cubes →
20256 vertices, 40512 faces.


For the extra credit I wanted the surface
2x(x²-3y²)(1-z²) + (x²+y²)² - (9z²-1)(1-z²),
which is a standard example of a genus-2 surface. That is a claim about topology, not
about what any single viewpoint shows, so I measured it rather than taking it on faith,
and the first attempt failed the measurement. On a box of half-width
1.35, counting edges from the faces gave
504 boundary edges,
meaning the mesh was open: my voxel box had quietly sliced the surface off, and
χ = -5 for an open mesh says
nothing at all. In the z = 0 plane the equation
reduces to r⁴ + 2r³cos3θ + 1 = 0, whose widest solution is the real
root of r⁴ - 2r³ + 1 = 0 other than 1, so the surface reaches
r ≈ 1.839 and a box of half-width 1.35 was never going to hold it. Widening the box to
2.0 at the same voxel pitch closes the mesh, and only then is the genus well defined:
48,208 vertices, 96,420 faces, one connected component, 0 boundary edges, 0 non-manifold edges → χ = V - E + F = -2, so genus 2. The torus above, measured the same way, comes out at χ = 0 and genus 1, which is the control that says the counter itself is right.
| Mesh (implicit + marching cubes) | Point cloud (parametric) | |
|---|---|---|
| Rendering quality | Watertight surface with shading and occlusion; silhouettes are clean. | Gaps unless sampled densely; no true surface, so lighting is flat and the far side bleeds through. |
| Memory | 20256 verts + 40512 faces, but the voxel grid (96³ ≈ 884,736 samples) is the real cost and it is transient. | Only the points: 200×200 = 40,000 for the torus. Lighter to store, no connectivity. |
| Speed | Grid evaluation + marching cubes took 1.41s here; rendering 81.03s. | No build step at all; rasterizing points is cheap. |
| Ease of use | Topology comes free: the genus-2 shape above needs no special handling. | Trivial to generate, but you must know a parameterization, which not every surface has. |
| Scaling | Cost grows with the cube of grid resolution, which bounds the detail you can afford. | Cost grows with the number of samples only. |
I wanted to use the sampler from Q7 for something other than a static point cloud, so this is the cow coming apart into its own surface samples and pulling itself back together: 45,000 points drawn with the Q7 area-weighted sampler, pushed outward from the centroid on a cosine schedule and tinted with the Q3 front-to-back palette.

Faces are drawn with probability proportional to area, then a uniform barycentric coordinate is sampled on the chosen face. Left to right: the original mesh (2,930 verts / 5,856 faces), then 10, 100, 1000, 10000 sampled points.
