• Create Account

### #ActualBacterius

Posted 13 March 2013 - 06:20 PM

I think what the diagrams indicate is the x-focal length and y-focal length, such that the actual focal length should be equal to sqrt(fx^2 + fy^2), by the Pythagorean Theorem. Though I don't fully understand the diagrams.

What I like to do is calculate only the corners of the focal plane, and interpolate the focal point for an arbitrary pixel using bilinear interpolation. It's clearer and a bit faster. Then the camera direction is just the focal point minus the camera position (normalized, of course). You might find some of my code useful: this, along with this.

### #1Bacterius

Posted 13 March 2013 - 06:19 PM

I think what the diagrams indicate is the x-focal length and y-focal length, such that the actual focal length should be equal to sqrt(fx^2 + fy^2), by the Pythagorean Theorem.

What I like to do is calculate only the corners of the focal plane, and interpolate the focal point for an arbitrary pixel using bilinear interpolation. Then the camera direction is just the focal point minus the camera position (normalized, of course). You might find some of my code useful: this, along with this.

PARTNERS