Create a gist now

Instantly share code, notes, and snippets.

@ikeryou /pixel.js
Last active Sep 1, 2016

What would you like to do?
3Dでのピクセル等倍
// カメラ座標
var cameraPos = new Vector3();
// ステージ高さ
var stageHeight = 900;
// 度単位でのカメラの視野
var fieldOfView = 45;
// ピクセル等倍になるカメラZ値
var z = stageHeight / Math.tan(fieldOfView * Math.PI / 360) / 2;
// -つけるかどうかはライブラリによるので注意
cameraPos.z = -z;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment