Skip to content

Instantly share code, notes, and snippets.

View mystroken's full-sized avatar
🍊

Mystro Ken mystroken

🍊
View GitHub Profile
var cameraZ = camera.position.z;
var planeZ = 5;
var distance = cameraZ - planeZ;
var aspect = viewWidth / viewHeight;
var vFov = camera.fov * Math.PI / 180;
var planeHeightAtDistance = 2 * Math.tan(vFov / 2) * distance;
var planeWidthAtDistance = planeHeightAtDistance * aspect;
// or
@mystroken
mystroken / 0_reuse_code.js
Created August 22, 2016 10:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console