Forum

new to VR - have a problem

07 January 2017 05:20
Taking my first try at modifying a scene to view thru Oculus Rift, I added what I think is the necessary code; however while I see a stereo image in the resulting app on my browser, when I try to view the scene thru my Rift I get a frozen hourglass, blackness, sometimes a broken image, or I get kicked back to the starting VR room. Any idea what I've done wrong?
07 January 2017 15:55
Hello.

Could you try to start this b4w VR example, please?

You can find this demo in SDK. You need to open main JS file (PATHTOSDK/apps_dev/space_disaster/space_disaster.js

The first requirment to get VR is correct setting stereo params in the m_app.init function:
m_app.init({
        canvas_container_id: "main_canvas_container",
        callback: init_cb,
        console_verbose: true,
        show_fps: show_fps,
        assets_dds_available: !DEBUG,
        assets_pvr_available: !DEBUG,
        assets_min50_available: !DEBUG,
        // NOTE: autoresize doesn't work with VR-mode in GearVR, bcz there is
        // a GearVR problem!!!
        autoresize: true,

        // change scene graph
        stereo: "HMD"
    });

Take a look at the stereo: "HMD" line

The second one is calling m_hmd.enable_hmd(m_hmd.HMD_ALL_AXES_MOUSE_NONE);
function load_cb(data_id) {
    if (m_hmd.check_browser_support()) {
        m_hmd.enable_hmd(m_hmd.HMD_ALL_AXES_MOUSE_NONE);
         var container = m_cont.get_container();
         container.addEventListener("click", function(e) {
        // go to VR-mode in case of using HMD (WebVR API 1.0)
        m_input.request_fullscreen_hmd();
         })
   }
}


If your browser supports WebVR API 1.0, you can enable rendering in your device only with user action, mouse click for example
Blend4Web developer
09 January 2017 07:38
OK, I'll poke around at this and see what happens. I'll have a followup question once I get this puzzled out.
 
Please register or log in to leave a reply.