小编Nig*_*l G的帖子

如何在 iOS 上将 DeviceOrientationEvent.webkitCompassHeading 与关联的 beta 和 gamma 值结合使用?

我已将 DeviceOrientationControls 修改为朝北,而不是设备启动时的方向,虽然它可以在 Android 上运行,但我在 iOS 版本上运行时遇到了困难。这是我的修改版本

/**
 * @author richt / http://richt.me
 * @author WestLangley / http://github.com/WestLangley
 *
 * W3C Device Orientation control (http://w3c.github.io/deviceorientation/spec-source-orientation.html)
 */

THREE.DeviceOrientationControls = function ( object ) {

    var scope = this;

    this.object = object;
    this.object.rotation.reorder( 'YXZ' );

    this.enabled = true;

    this.deviceOrientation = {};
    this.screenOrientation = 0;

    this.alphaOffset = 0; // radians
    this.absolute = false;
    this.alphaOffsetDevice = undefined;
    this.alphaOffsetScreen = undefined;

    var onDeviceOrientationChangeEvent = function ( event ) {
        if(scope.absolute) return;

        scope.deviceOrientation = event;

    }; …
Run Code Online (Sandbox Code Playgroud)

javascript ios three.js

6
推荐指数
0
解决办法
752
查看次数

标签 统计

ios ×1

javascript ×1

three.js ×1