MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / projectVertex

Function projectVertex

assets/js/block_ninja.js:500–505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

498// 3D projection on a single vertex.
499// Directly mutates the vertex.
500const 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.

Callers 1

glueShedSparksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected