Krpano WebVR cursor position

  • Hi,

    it can/need to be calculated.

    The depth/distance of the target position need to be given from somewhere, e.g. when hitting a hotspot there is the hitd variable which defines the distance to the hitpoint on the hotspot plane.

    See the in webvr.xml the 'vrcontroller_target_point' action as example.

    Best regards,
    Klaus

  • Thanks for the answer!

    I've looked at the webvr.xml the 'vrcontroller_target_point', but the calculations used there don't seem to return the correct values in my js plugin.
    Am I using the right krpano hotspot variables?
    Also the distance (hitd) is always 0 for some reason.

    I'm using Oculus GO headset with Firefox reality browser installed for remote debugging. I'm testing this on 'webvr-controllers' pano.

    And here's the relevant piece of code:

    Code
    var controllers = krpano.get("webvr.vrcontrollers");
    var mainController = controllers[0];
    var distance;
    if(mainController.hs.hitd > 0)
        distance = mainController.hs.hitd;
    else
        distance = 1000;
    var clickX = mainController.hs.tx + mainController.hs.dx * distance;
    var clickY = mainController.hs.ty + mainController.hs.dy * distance;

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!