Last active
July 23, 2018 06:39
-
-
Save ikeryou/49b318feb8571bcb04e85097577e0dd0 to your computer and use it in GitHub Desktop.
3Dでのピクセル等倍
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// カメラ座標 | |
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