| 498 | // 3D projection on a single vertex. |
| 499 | // Directly mutates the vertex. |
| 500 | const projectVertex = v => { |
| 501 | const focalLength = cameraDistance * sceneScale; |
| 502 | const depth = focalLength / (cameraDistance - v.z); |
| 503 | v.x = v.x * depth; |
| 504 | v.y = v.y * depth; |
| 505 | }; |
| 506 | |
| 507 | // 3D projection on a single vertex. |
| 508 | // Mutates a secondary target vertex. |