I have positioned my camera at a distance of 850 (camera.position.z = 850) and camera.setlens(50) and perspective FOV as 70. How can I calculate width and height of View (I just want to draw cube so I want the width and height of View which changes from camera distance.)
Asked
Active
Viewed 183 times
0
-
Duplicate of http://stackoverflow.com/questions/13350875/three-js-width-of-view/ – WestLangley Mar 11 '14 at 04:26
-
var vFOV = camera.fov * Math.PI / 180; // convert vertical fov to radians var height = 2 * Math.tan( vFOV / 2 ) * dist; // visible height var aspect = window.width / window.height; var width = height * aspect; I know this calculation but I just want to know how dist is calculated with respect to camera.setlens will this change anything. is below calculation correct in my case. var vFOV = 70 * Math.PI / 180; var height = 2 * Math.tan(vFOV / 2) * 850; var aspect = window.innerWidth / window.innerHeight; var width = height * aspect; will setlens involves in the calculation. – user3363468 Mar 11 '14 at 04:32
-
As aspect ratio is same, I want to know screen width and height with respect to camera position so that I can draw a cube dynamically with respect to height and width of screen which is changed with respect to camera. – user3363468 Mar 11 '14 at 04:52