Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device Orientation Controls for mobile #21

Open
dczaretsky opened this issue Jan 6, 2016 · 2 comments
Open

Device Orientation Controls for mobile #21

dczaretsky opened this issue Jan 6, 2016 · 2 comments

Comments

@dczaretsky
Copy link

Thanks for building this!

But I'm stuck on how to integrate the orientation controls for mobile devices (specifically iOS). Basically, I want to control the panning with the mobile device's gyros and accellerometers. I see that threejs has the capability in DeviceOrientationControls.js, but I can't figure out how to attach that to the camera object in your Photo Sphere Viewer.

Can you provide some assistance?

@JeremyHeleine
Copy link
Owner

Photo Sphere Viewer provides a button in the navigation bar to let the user navigate through the panorama using their device's orientation. However, this button is shown only if the used API is supported so, if you can't see it, maybe you use a browser which is not compatible (I think Apple's browser is not).

@sem4phor
Copy link

sem4phor commented Dec 12, 2018

You basically have to import the three/examples/js/controls/DeviceOrientationControls.js file (which itself requires THREE itself). To provide THREE to the example file in webpack you have to do following config:

module: {
      rules: [{
        test: /three\/examples\/js/,
        use: 'imports-loader?THREE=three'
      }]
    }

(Which uses the package webpack imports-loader)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants