ofCamera - object looks stretched when far from center

Hi, I’m trying to figure out how to properly use ofCamera.

So I made this test app that simply rotates between two spheres.

As you can see, the camera is in the middle, and it is rotating it’s orientation to look through the 2 spheres.

And this is camera’s view when it looks at the left sphere.

But when the sphere gets far from the center of camera’s view, it starts to look stretched which I personally think is pretty unnatural.

Could someone please tell me why this is happening and how to fix this?

@cuinjune

it may be field of view.
You can handle it with ofCamera::setFov().

http://openframeworks.cc/documentation/3d/ofCamera/#show_setFov

1 Like

That’s actually a non-distorted image, we’re used to lens distortion, either from a camera lens or from our own eyeballs. Note this undistorted image:

And how the paintings next to the image boundaies are stretched. As @yuma_taesu says, you can change Fov to hide this.

You could also go nuts and implement distortion, as they do with VR headsets to make it look more natural. That’s usually overkill for most applications. Here’s a nice resource on that direction, they even have a live demo

3 Likes

Thank you very much for your explanation :slight_smile:

@chuckleplant sweet image and explanation!

I sometimes use cam.enableOrtho() to experiment with orthographic projections – you loose all scaling based on z but I find it’s really useful for removing that kind of stretching and it often times helps.

1 Like