Forum

Possible hmd_conf example?

04 June 2016 04:19
Hi all,

I've been trying to use 16.05 for a project I did in 16.04 that used the HMD module.
After replacing blend4web and uranium scripts with the latest 16.05 version my screen becomes black after the scene loads whenever HMD is set to stereo. However on 16.04 it works as expected.
For some reason navigator.getVRDevices is undefined in Chromium on May 21st build. Thus hmd_conf.check() always returns false. Possibly a bug? navigator.getVRDisplays is however defined.

I was wondering if someone could be kind enough to provide an example of using the configurator.
Another problem I have is that I register my b4w after some interaction of user with DOM (link with onclick event calling load_b4w() ). So seems like configurator can only be accessed once b4w is registered?

Thank you in advance.

PS. here is a link for the project: http://bit.ly/1XqcRLP
Source code can be found here: http://bit.ly/28a06rV
Would love to get some feedback or some suggestions on improvements and better implementation/development.
06 June 2016 12:01
Hello hsab! And welcome to the our forum.

After replacing blend4web and uranium scripts with the latest 16.05 version my screen becomes black after the scene loads whenever HMD is set to stereo. However on 16.04 it works as expected.

There is a bug, we are going to fix it. But it is better to use HMDParams object (it was changed in 16.03). Sorry for that.

For example,
m_scene.set_hmd_params({
          enable_hmd_stereo: true,

          // Inter-lens distance / mobile screen width,
          //  For example: 0.064 / 0.128
          inter_lens_factor: 0.5,

          // Tray to lens-center distance / (mobile screen height - mobile bevel size),
          // For example: 0.032 / (0.067 - 0.003)
          base_line_factor: 0.5,
          distortion_coefs : [0.22, 0.28],
          chromatic_aberration_coefs : [-0.015, 0.02, 0.025, 0.02]
        });

You need to change 194 line of eluded.js.

For some reason navigator.getVRDevices is undefined in Chromium on May 21st build. Thus hmd_conf.check() always returns false. Possibly a bug? navigator.getVRDisplays is however defined.

Right now, the Blend4Web engine doesn't support WebVR 1.0, but it support WebVR (old). We are going to support new specification.

I was wondering if someone could be kind enough to provide an example of using the configurator.

You can see m_hmd_conf object in viewer.js and webplayer.js.
Blend4Web Team
kirill@blend4web.com
 
Please register or log in to leave a reply.