Download

Get FOV of Camera once in AR

Hi all,

For this AR project we are developing, I need to create a mesh that more or less works as a UI element despite being in 3D space. It scales to fit the screen to be as large as possible without cropping, no matter the aspect ratio or FOV. In the attached gif below you will see I have this all working already within the editor/PC build, and on a smartphone device before AR Session is enabled.

The problem is that in AR it seems I do not have access to the true FOV of the camera (as the FOV value of the pawn camera does not seem to update to reflect its overriden value once in AR). So my question is how do I get the true FOV value once in AR? Surely this information must exist SOMEWHERE???

Example of resizing to fit to screen.


The function I am using to achieve this.

Everything works, both on PC and on Smartphone, until I enable AR Session and then the resizing is totally wrong. All I need is to somehow access the correct field of view once in AR.
If anything is unclear, please let me know.

Thank you!

Hi,

getting the field of view from the camera component in the ar pawn works fine for me.
make sure you let your code run gain after the ar session started.

But your image shows a UI/text in the viewport. So does it really have to be a mesh?
If you want text/UI in 3d space, consider using a widget component. Attach it to the player camera. Much better solution.

Widget Component:

@CosmicLobster Hi thanks for the reply.
Does FOV work for you? I am returning a fov the problem is its the fov of before AR, which is no longer accurate at all once an AR session has started. In the example above I was getting FOV every frame.

The reason it is a mesh is it needs to use normals/specular etc.
Ive since realised maybe an easier solution is to infact make it a widget and fake normals etc inside of a widget material as accurately as I can with an input vector for light direction.

A shame though as it is 100% working outside of AR.