An orientation-aware Virtual Reality controller for web browsers built on top of three.js http://richtr.github.io/threeVR/examp…

3997
    


来源:
Licence:
联系:
分类:
平台:
环境:
大小:
更新:
标签:
联系方式 :
免费下载 ×

下载APP,支持永久资源免费下载

限免产品服务请联系qq:1585269081

下载APP
免费下载 ×

下载APP,支持永久资源免费下载

下载APP 免费下载
下载 ×

下载APP,资源永久免费


如果出现不能下载的情况,请联系站长,联系方式在下方。

免费下载 ×

下载论文助手APP,资源永久免费

免费获取

如果你已经登录仍然出现不能下载的情况,请【点击刷新】本页面或者联系站长


threeVR An orientation-aware Virtual Reality controller for three.js threeVR is a virtual reality controller that makes it easy to build device-orientation aware applications on top of the three.js library. threeVR listens for device orientation event changes and orients a three.js scene in the direction the user is facing. This library also provides manual user override controls so users can drag to look around a scene and pinch to zoom in on scene features. Once user interaction is complete, the threeVR library snaps the scenes camera back to the current device orientation position. threeVR also provides a set of custom event callbacks that web applications can use to build their own compelling user interfaces. Live Demo | Basic Usage | API | Reference Material | License Basic Usage Add three.js and DeviceOrientationController.js to your project: Create a new DeviceOrientationController object in JavaScript passing in your scenes camera (required) and the target domElement object (optional, defaults to the document object). Then call connect() to start the controller. API connect() Start the controller and register all required deviceorientation and manual interaction override event listeners Example: controls.connect(); // start listening for device orientation changes disconnect() Stop the controller and de-register all required deviceorientation and manual interaction override event listeners Example: controls.disconnect(); // stop listening for device orientation changes addEventListener(type, callback) Register an event handler when events fire in the DeviceOrientationController object. Available event types are: compassneedscalibration - when the system compass indicates that it needs calibration orientationchange - when the screen orientation changes (e.g. the user rotates their screen from portrait to landscape or vice-versa). The current screen orientation can subsequently be read from controls.screenOrientation . userinteractionstart - when the user starts manually overriding deviceorientation controls by interacting with the renderer DOM element. userinteractionend - when the user ends manually overriding deviceorientation controls by interacting with the renderer DOM element. zoomstart - when the user manually starts zooming the scene in the renderer DOM element. zoomend - when the user manually ends zooming the scene in the renderer DOM element. rotatestart - when the user manually starts rotating the scene in the renderer DOM element. rotateend - when the user manually ends rotating the scene in the renderer DOM element. Example usage: controls.addEventListener(userinteractionstart, function() { controls.element.style.cursor = move; }); controls.addEventListener(userinteractionend, function() { controls.element.style.cursor = normal; }); removeEventListener(type, callback) De-register an event handler previously registered with addEventListener(type, callback) . freeze Prevent device orientation from updating the camera position. Example: controls.freeze = true; // pause deviceorientation affecting camera rotation enableManualDrag Whether to allow the user to manually override the automatic deviceorientation controls by dragging the scene to rotate the camera manually. The camera will automatically snap back to the deviceorientation when the user stops interacting with the scene. Default is true . Example: controls.enableManualDrag = false; // disable user manual scene drag-to-rotate override enableManualZoom Whether to allow the user to manually override the automatic deviceorientation controls by pinching the scene to zoom manually. The camera will automatically snap back to the deviceorientation when the user stops interacting with the scene. Default is true . Example: controls.enableManualZoom = false; // disable user manual scene pinch-to-zoom override useQuaternions Whether to use quaternions to calculate the device orientation ( true ) or rotation matrices ( false ). Default is true . Example: controls.useQuaternions = false; // use rotation matrix math Reference Material Article: Practical application and usage of the W3C Device Orientation API W3C Spec License MIT. Copyright (c) Rich Tibbett


免费下载 ×

下载APP,支持永久资源免费下载

下载APP 免费下载
温馨提示
请用电脑打开本网页,即可以免费获取你想要的了。
扫描加我微信 ×

演示

×
登录 ×


下载 ×
论文助手网
论文助手,最开放的学术期刊平台
				暂无来源信息			 
回复
来来来,吐槽点啥吧

作者联系方式

×

向作者索要->