MCPcopy Index your code
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / projectVertexTo

Function projectVertexTo

assets/js/block_ninja.js:509–514  ·  view source on GitHub ↗
(v, target)

Source from the content-addressed store, hash-verified

507// 3D projection on a single vertex.
508// Mutates a secondary target vertex.
509const 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

Callers 1

projectMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected