Wow, first I felt baffled and now I feel stupid.
This gave me hours of desperation. I assumed everything from wrong initialization of my image up to driver bugs but didn't see this mistake.
Thank you very much!
But the first way of writing it is much easier to read: The exponential of x is one plus x plus x squared over 2 plus something that grows slower than x^2.
I agree that the first formula is easier to read when you know what this means, but when I started learning the big O notation and set theory the first formula was still a bit confusing in the beginning. I always tended to write it like this:
It was much clearer especially at the beginning, but it is longer and thus my CS professor abused the notation due to laziness.
Thanks a lot! Your code helped me to figure out that I totally forgot to normalize the scale of my image plane.
Before normalization my image plane was centered around (0,0,500) and the top left corner around (-512, 384, 500) in world space. Without adjustments of the object positions and sizes absolutely nothing could be seen.
Now I used your proposed equation for the focal length f:
Everything works fine by now though I still have a question. When I choose a wide angle for the horizontal field of view, let's say 120°, I see spheres getting oblong at the border of the screen. Is this the so called "fisheye"-effect due to a wide field of view?
I just skimed through the posts and I think all the important things have already been said.
But there is one thing which bothers me, always had and always will. Formally it is not correct to write
for example. O(n) is a set of functions and therefore f(x) can only be an element of this set. One should write