Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Acquire FOV from ARCore #52

Closed
error454 opened this issue Feb 27, 2019 · 2 comments
Closed

Acquire FOV from ARCore #52

error454 opened this issue Feb 27, 2019 · 2 comments

Comments

@error454
Copy link

I am trying to fit some 3D menu items to fill the screen and it would be very helpful to be able to query the horizontal or vertical field of view when using ARCore.

I tried looking at the projection matrix calculation but the implementation for ArCamera_getProjectionMatrix seems to be in another library. If I could see how this matrix is constructed, I could work backward.

@bopangzz
Copy link
Contributor

Check out the ComputerVision sample. It calculated the camera FOV based on the camera intrinsics there.

@error454
Copy link
Author

Thanks, I did find it tucked away in one of those BP's. If it helps anyone, here is the C++ equivalent using the image intrinsics:

const float FOVHor = 2.f * FMath::RadiansToDegrees(FMath::Atan2(ImageSizeX, 2.f * FocalLengthX));
const float FOVVer = 2.f * FMath::RadiansToDegrees(FMath::Atan2(ImageSizeY, 2.f * FocalLengthY));

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants