I’m stitching together an image using multiple instances of the sandy.primitive.Box. Each box is 96×91 while the viewport is 960×273 which should make for an exact fit if I layout the boxes in a perfect grid of 10×3. However, I can’t seem to get the exact camera fieldOfView. I’ve tried a couple formulas (one for adjusting the “focal length” and one for adjusting the fov, directly). Both of these formulas produce a fov angle that is too narrow.
// focal length
(stage.stageHeight/2) / Math.tan(cam.fov / 2 * Math.PI / 180)
// field of view
2 * Math.atan2( (stage.stageHeight/2), -cam.z ) * (180 / Math.PI)
Another question about the same project:
I need to adjust the perspective of each cube so that the image appears to be in 2D space (flat)… Any ideas on the best method for calculating such a “correction”?
I realized shortly after posing this question that I wasn’t taking into account the cubes’ depth (actually, half of the depth) when determining the distance.