(v, target)
| 507 | // 3D projection on a single vertex. |
| 508 | // Mutates a secondary target vertex. |
| 509 | const projectVertexTo = (v, target) => { |
| 510 | const focalLength = cameraDistance * sceneScale; |
| 511 | const depth = focalLength / (cameraDistance - v.z); |
| 512 | target.x = v.x * depth; |
| 513 | target.y = v.y * depth; |
| 514 | }; |
| 515 | |
| 516 | |
| 517 |