[SOLVED] Is it possible hardcode a custom VR cardboard viewer profile in Playcanvas?


#1

Hi

I am working on a WebVR project that needs to be compatible with a custom cardboard viewer (with different specs to the google cardboard viewer). I have already generated a custom viewer profile using the Google Viewer Profile Generator.

This works great and I can now configure my phone to use my custom VR viewer by scanning a QR code.
But I would like to avoid this extra step – is there some way to force the app to always use my custom cardboard viewer profile? Is there something in the API that could help?

Thank you all for your time and help.


#2

Hi. Have you set up your custom Google Cardboard profile to work in a browser? I was able to set up a profile only for native applications, but if I open the application in a browser, I have only two profiles available:
Profile

I found code in the webvr-polyfill.js script that is responsible for the parameters of these profiles, however there is an array of inverseCoefficients that contains many obscure values. You don’t know how to get these values for your Google Cardboard profile? If you open the profile generator, then there are no settings data.


#3

Hi,

We were working on this project over 2 years ago so can’t fully remember but I think we ended up measuring / calculating our viewer data manually and then hard coded the data in the polyfill directly.


#4

Thanks for the answer. I decided to do the same. :grinning: