FOV Values

Hello guys,

I was thinking about the scene area and I saw that in certain point the object disappear. Is that a FOV? Is there anyway to change his value? If don’t, is there any plan to implement it in Studio?

att, Higão.

1 Like

FOV Values?

Steve

2 Likes

Hi @higor,

I think you mean the clipping planes. Perspective camera transforms (such as Z.camera) only show objects between a specified near and far distance. Historically in Zappar these were fixed at z=-0.1 for the near clip plane, and z=-150 for the far clip plane.

For world tracked scenes where units are measured in meters it is sometimes handy to make that near clip plane a bit closer to the camera (so you can get closer to objects before they are clipped).

There are now some properties on Z.CameraTransform that allow you to set these. We haven’t yet added these to the typescript definition files or the Studio UI, but that will come in future releases. For now I’d recommend code like this:

(<any>Z.camera).nearClippingPlane(-0.02); // 2cm for world-tracked scenes
(<any>Z.camera).farClippingPlane(-30); // 30m for world-tracked scenes

// Typescript doesn't know about these functions but they were added in v450
// The RequiresVersion line ensures the minimum version will be set correctly
// so the functions above will exist
Z.RequiresVersion.v450;

The planes are always in front of the camera (ie negative Z values, even if you pass positive numbers to those properties). The near one can’t be at 0 either, and the precision of the depth buffer is very sensitive to how close the near plane is to 0, and is also to do with the relative distances between the planes. That’s why I set both of the planes closer to the camera in the code above. If you don’t have enough precision in the depth buffer due to setting the clipping planes too far apart, you may see that as “Z-fighting” between objects in the scene - see for example https://en.wikipedia.org/wiki/Z-fighting.

4 Likes