{"action":"created","issue":{"url":"https://api.github.com/repos/immersive-web/webvr-polyfill/issues/310","repository_url":"https://api.github.com/repos/immersive-web/webvr-polyfill","labels_url":"https://api.github.com/repos/immersive-web/webvr-polyfill/issues/310/labels{/name}","comments_url":"https://api.github.com/repos/immersive-web/webvr-polyfill/issues/310/comments","events_url":"https://api.github.com/repos/immersive-web/webvr-polyfill/issues/310/events","html_url":"https://github.com/immersive-web/webvr-polyfill/issues/310","id":306086144,"number":310,"title":"Initial orientation correction in hotfix (chrome m65)","user":{"login":"env3d","id":4198867,"avatar_url":"https://avatars3.githubusercontent.com/u/4198867?v=4","gravatar_id":"","url":"https://api.github.com/users/env3d","html_url":"https://github.com/env3d","followers_url":"https://api.github.com/users/env3d/followers","following_url":"https://api.github.com/users/env3d/following{/other_user}","gists_url":"https://api.github.com/users/env3d/gists{/gist_id}","starred_url":"https://api.github.com/users/env3d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/env3d/subscriptions","organizations_url":"https://api.github.com/users/env3d/orgs","repos_url":"https://api.github.com/users/env3d/repos","events_url":"https://api.github.com/users/env3d/events{/privacy}","received_events_url":"https://api.github.com/users/env3d/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-03-16T21:45:04Z","updated_at":"2018-03-17T20:21:19Z","closed_at":null,"author_association":"NONE","body":"##### Description:\r\n\r\nIn Chrome m65, after the latest hotfix patch, the starting orientation is off by 45 degrees.  To reproduce, simply visit the example page https://immersive-web.github.io/webvr-polyfill/examples/ with an affected browser.  You will see the cube flashed and then the orientation is turned at 45 degree angle.\r\n\r\nI patched the cardboard-vr-display with the following, which seems to fix the issue:\r\n\r\n```\r\ndiff --git a/src/sensor-fusion/fusion-pose-sensor.js b/src/sensor-fusion/fusion-pose-sensor.js\r\nindex 43bd398..7b2dec9 100644\r\n--- a/src/sensor-fusion/fusion-pose-sensor.js\r\n+++ b/src/sensor-fusion/fusion-pose-sensor.js\r\n@@ -91,10 +91,10 @@ FusionPoseSensor.prototype.getOrientation = function() {\r\n       const z = new MathUtil.Quaternion().setFromAxisAngle(new MathUtil.Vector3(0, 0, -1), 0);\r\n       const y = new MathUtil.Quaternion()\r\n \r\n-      if (window.orientation === -90) {\r\n-        y.setFromAxisAngle(new MathUtil.Vector3(0, 1, 0), Math.PI / -2);\r\n+      if (window.orientation === 90) {\r\n+        y.setFromAxisAngle(new MathUtil.Vector3(0, 1, 0), Math.PI + (Math.PI / 4));\r\n       } else {\r\n-        y.setFromAxisAngle(new MathUtil.Vector3(0, 1, 0), Math.PI / 2);\r\n+        y.setFromAxisAngle(new MathUtil.Vector3(0, 1, 0), Math.PI / -4);\r\n       }\r\n \r\n       return z.multiply(y);\r\n```\r\n\r\n##### Additional Information:\r\n\r\n* webvr-polyfill version: 0.10.4\r\n* Browser name/version/release channel: Chrome M65 (on my MotoZ play)\r\n* Operating System: Android\r\n"},"comment":{"url":"https://api.github.com/repos/immersive-web/webvr-polyfill/issues/comments/373949769","html_url":"https://github.com/immersive-web/webvr-polyfill/issues/310#issuecomment-373949769","issue_url":"https://api.github.com/repos/immersive-web/webvr-polyfill/issues/310","id":373949769,"user":{"login":"env3d","id":4198867,"avatar_url":"https://avatars3.githubusercontent.com/u/4198867?v=4","gravatar_id":"","url":"https://api.github.com/users/env3d","html_url":"https://github.com/env3d","followers_url":"https://api.github.com/users/env3d/followers","following_url":"https://api.github.com/users/env3d/following{/other_user}","gists_url":"https://api.github.com/users/env3d/gists{/gist_id}","starred_url":"https://api.github.com/users/env3d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/env3d/subscriptions","organizations_url":"https://api.github.com/users/env3d/orgs","repos_url":"https://api.github.com/users/env3d/repos","events_url":"https://api.github.com/users/env3d/events{/privacy}","received_events_url":"https://api.github.com/users/env3d/received_events","type":"User","site_admin":false},"created_at":"2018-03-17T20:21:19Z","updated_at":"2018-03-17T20:21:19Z","author_association":"NONE","body":"Ok, so I ran a couple of tests, with interesting results.  All tests are conducted using chrome m65 on Android.  I have 3 phones:  a MotoZ Play, a LG G3, and an Acer Zest Plus.\r\n\r\nOn the first test, I attach a deviceorientation event and print out the alpha, beta, and gamma values for each.  I have the following results:\r\n\r\n![20180317_125522](https://user-images.githubusercontent.com/4198867/37559562-9c10cd3c-29e5-11e8-9aa3-0199aa4aea25.jpg)\r\n\r\nAs can be seen, the alpha value reported (which translates to the 'look' orientation, rotateY if you will of the head), is all different on all 3 phones.\r\n\r\nFor the second test, I have 2 event handlers, top is deviceorientation and bottom is devicemotion.\r\n\r\n![20180317_131221](https://user-images.githubusercontent.com/4198867/37559584-d837394a-29e5-11e8-9330-88aa919b6846.jpg)\r\n\r\nNoticed for 2 phones (motoZ and LG G3), they are showing null for all values, while the Acer has nulls on the deviceorientation but starting reporting on the devicemotion, but only in the acceleration with gravity field.\r\n\r\nHopefully this will give us more insights into what is happening.\r\n\r\nThanks"}}
{"actor":{"display_login":"env3d"}}