device-orientation

Object rotation using the Device Orientation Controls in Three.js

烂漫一生 提交于 2021-02-07 20:17:25
问题 I am making my first steps coding with JavaScript and playing with Three.js. I am experimenting with this example from threejs.org :http://threejs.org/examples/#misc_controls_deviceorientation and this is the code that they have: (function() { "use strict"; window.addEventListener('load', function() { var container, camera, scene, renderer, controls, geometry, mesh; var animate = function(){ window.requestAnimationFrame( animate ); controls.update(); renderer.render(scene, camera); };

iPhone 6s Plus has Compact horizontal size class in landscape orientation

只谈情不闲聊 提交于 2020-12-15 07:03:56
问题 I have an iPhone 6s Plus, and I have an app that supports both Portrait and Landscape orientations. When I rotate my device and read the property mainViewController.traitCollection.horizontalSizeClass - it always equals UIUserInterfaceSizeClassCompact . Many sources like this: https://forums.developer.apple.com/thread/17085 or this: http://useyourloaf.com/blog/size-classes/ tell that all 5.5-inch iPhones have Regular horizontal size class in the landscape orientation, but my device doesn't!!!

iPhone 6s Plus has Compact horizontal size class in landscape orientation

核能气质少年 提交于 2020-12-15 07:00:51
问题 I have an iPhone 6s Plus, and I have an app that supports both Portrait and Landscape orientations. When I rotate my device and read the property mainViewController.traitCollection.horizontalSizeClass - it always equals UIUserInterfaceSizeClassCompact . Many sources like this: https://forums.developer.apple.com/thread/17085 or this: http://useyourloaf.com/blog/size-classes/ tell that all 5.5-inch iPhones have Regular horizontal size class in the landscape orientation, but my device doesn't!!!

onHeadingChange(event) getting single value for geometrically opposite positions

旧街凉风 提交于 2020-08-09 07:10:23
问题 I am working on android device orientation and getting same values of event.alpha (270) in following positions as shared in image. i am using following code: // called on device orientation change function onHeadingChange(event) { var heading = event.alpha; if (typeof event.webkitCompassHeading !== "undefined") { heading = event.webkitCompassHeading; //iOS non-standard } if (typeof heading !== "undefined" && heading !== null) { alert("heading:"+ heading); } } 来源: https://stackoverflow.com