Sceneform-android-sdk: Control over camera aperture angle when not using ARCore

Created on 1 Aug 2018  路  3Comments  路  Source: google-ar/sceneform-android-sdk

Looking at the SceneForm Camera code it would appear that the aperture angle (aka fovy in http://www.mathematik.uni-marburg.de/~thormae/lectures/graphics1/graphics_6_1_eng_web.html#19) is hardwired to 90 degrees when ARCore is not used.

That does not allow one to match the actual camera intrinsics to do AR on non-ARCore devices -- and in general would seem to provide insufficient control over the camera.

feature request

Most helpful comment

I need the feature badly as well... really appreciate adding an view angle setter

All 3 comments

If setPerspective(float, float, float, float) was not private, we could just subclass Camera an ignore and override the first argument as a quick hack of a fix.

Of course, the real fix is to provide a camera angle setter (a getter is not really necessary), call refreshProjectionMatrix() if isArCamera is false, and use the angle in question in refreshProjectionMatrix() rather than 90.

I'm not sure if there's any clean way to thwack/patch this class until a fix is provided, unfortunately. Ideas?

I need the feature badly as well... really appreciate adding an view angle setter

There is a public API in last (1.13.0) release - https://developers.google.com/ar/reference/java/sceneform/reference/com/google/ar/sceneform/Camera#setVerticalFovDegrees(float)

But take care, using this API dramatically decrease performance on some devices :( I'll attach an issue link a bit later

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tigran-babajanyan picture tigran-babajanyan  路  3Comments

StevenOttoG picture StevenOttoG  路  4Comments

kunal-wayfair picture kunal-wayfair  路  3Comments

michaelvogt picture michaelvogt  路  4Comments

arilotter picture arilotter  路  3Comments