{"id":32247,"date":"2017-06-13T18:27:49","date_gmt":"2017-06-14T01:27:49","guid":{"rendered":"http:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/"},"modified":"2017-06-13T18:27:49","modified_gmt":"2017-06-14T01:27:49","slug":"webvr-controllers-and-chromiums-gamepad-api","status":"publish","type":"post","link":"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/","title":{"rendered":"WebVR controllers and Chromium\u2019s Gamepad API."},"content":{"rendered":"<figure><img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2017\/06\/12AxwXq_cvZL0fcrDJ9ikITcA.jpeg?w=900\"><\/figure>\n<p><strong>TL;DR<\/strong>: The <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Gamepad_API\/Using_the_Gamepad_API\">Gamepad API<\/a> can be a quirky thing. But if you\u2019re building Three.js-based interactive <a href=\"https:\/\/webvr.rocks\/\">WebVR<\/a> experiences you can just use this generic <a href=\"https:\/\/github.com\/stewdio\/THREE.VRController\">VRController.js<\/a> and call it a\u00a0day.<\/p>\n<p>I\u2019ve been building virtual reality experiences with the <a href=\"https:\/\/webvr.rocks\/\">WebVR API<\/a> for some time now\u2014primarily for the HTC Vive, but the beauty of making virtual reality for the Web is that it will also run on the Oculus Rift, Google Daydream, and so on with little additional effort. (It is the Web, after all!) In 2016 I <a href=\"https:\/\/medium.com\/@stew_rtsmith\/day-and-night-f5f2a56112ea\">wrote a Medium post<\/a> about my first experience with virtual reality and my first \u201cpolished\u201d WebVR experiment, <a href=\"https:\/\/dayandnight.moar.io\/\">Day &#038;\u00a0Night<\/a>.<\/p>\n<p>While working on Day &#038; Night I contributed to <a href=\"https:\/\/threejs.org\/\">Three.js<\/a>\u2019s <a href=\"https:\/\/github.com\/mrdoob\/three.js\/blob\/dev\/examples\/js\/vr\/ViveController.js\">ViveController<\/a> class by adding simple button events. This tiny exercise inspired me to take things further by creating a <a href=\"https:\/\/github.com\/stewdio\/THREE.VRController\">generic VRController class<\/a> that could support several controller models at once. (With many thanks to <a href=\"https:\/\/medium.com\/@borismus\">Boris Smus<\/a> for allowing us to use his OrientationArmModel to better support 3DOF controllers.) I submitted a <a href=\"https:\/\/github.com\/mrdoob\/three.js\/pull\/10991\">pull request to add VRController to Three.j<\/a>s back in March and in the meantime I\u2019m more actively maintaining that generic VRController code\u00a0here:<\/p>\n<p><a href=\"https:\/\/github.com\/stewdio\/THREE.VRController\">stewdio\/THREE.VRController<\/a><\/p>\n<p>The backbone of VRController is the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Gamepad_API\/Using_the_Gamepad_API\">Gamepad API<\/a> and over the course of reading the docs and experimenting with it I\u2019ve refined my understanding of its occasional absurdities in the <a href=\"https:\/\/webvr.info\/get-chrome\/\">WebVR build of Chromium<\/a> ? (Written in jest\u2014I am a strong admirer of <a href=\"http:\/\/blog.tojicode.com\/\">Brandon Jones<\/a> and his efforts both with the Gamepad API and WebVR API, as well as the efforts of his colleagues and counterparts elsewhere.) Here are some relevant observations that you can follow along with in your JavaScript console\u2014provided you have a VR rig attached and you\u2019re using the <a href=\"https:\/\/webvr.info\/get-chrome\/\">WebVR build of Chromium<\/a>. (If you\u2019re one of the handful of folks making WebVR right now there\u2019s a good chance you have this setup in place already.)<\/p>\n<ol>\n<li>With both of your VR controllers turned off, open a fresh browser window. You don\u2019t need to load any particular website in it because our experimenting will take place right in the JavaScript console. So fire up the console and type navigator.getGamepads(). It will return an Array with four empty slots. We\u2019re off to a good\u00a0start.<\/li>\n<li>Power on a single controller but do not touch any of the buttons or trackpads. navigator.getGamepads() will still return an Array with four empty slots. This is a privacy protection feature: The Gamepad API requires a user interaction before it will allow JavaScript to know that the gamepad exists. Does your UX reflect this? You can\u2019t just tell your user to power up their controller\u2014you have to let them know they need to hit a button too. If you don\u2019t communicate this properly they will just think your junk is borked. And at that point it effectively is.<\/li>\n<li>Touch any button on your powered-on controller. Bam! Now the controller exists. But wait\u2026 Yes, the controller you turned on exists <strong>but the controller you did not turn on also exists!<\/strong> Ghost controller! You\u2019ll notice navigator.getGamepads()is now returning an Array with Gamepad instances in the first two slots, followed by two empty slots. Both of these instances report connected: true even though one is not even powered on. Madness! (And how does it know there\u2019s supposed to be a second controller? Is that from using two controllers with this browser previously?) If you inspect the pose object of each you\u2019ll see that the controller you turned on has real Float32Arrays for position and orientation while the other controller\u2019s position and orientation are set to null. At least that part makes\u00a0sense.<\/li>\n<li>Now turn off the controller you powered on. The Gamepad API will still report that it exists! So now you have two ghost controllers and both instances deceptively claim connected: true.<\/li>\n<li>Keep both controllers powered off. Hard refresh the page. navigator.getGamepads() still reports those controllers are connected!<\/li>\n<li>So how do you restore sanity? Leave your current browser window open while opening a fresh one. In the new window navigator.getGamepads() reports four empty slots. Phew! Normalcy again! (But of course the old browser window still reports two gamepads are connected.) At this point your new window mirrors Step 1 above and you can run the whole cycle over\u00a0again.<\/li>\n<\/ol>\n<p>To wrangle this Gamepad API behavior into something more intuitive, VRController only accepts a gamepad as \u201cexisting\u201d\u2014and thus fires a connection event\u2014when its pose object contains either a valid position or valid orientation object. And if at any point both of these become null again (ie. the gamepad loses tracking) VRController will fire a disconnection event. Perhaps it\u2019s not the most elegant solution but over the course of some experimentation and iteration it does seem the most useful for handling controllers across Chromium, Firefox, and\u00a0beyond.<\/p>\n<p>If you\u2019re building virtual reality websites with <a href=\"https:\/\/threejs.org\/\">Three.js<\/a> give <a href=\"https:\/\/github.com\/stewdio\/THREE.VRController\">VRController<\/a> a spin and leave your feedback either here or on <a href=\"https:\/\/github.com\/stewdio\/THREE.VRController\">GitHub<\/a>. And if you have more insight into using the Gamepad API with VR controllers in general do contribute!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/medium.com\/_\/stat?event=post.clientViewed&#038;referrerSource=full_rss&#038;postId=6c9adc633f38\" width=\"1\" height=\"1\"><\/p>\n<p class=\"wpematico_credit\"><small>Powered by <a href=\"http:\/\/www.wpematico.com\" target=\"_blank\">WPeMatico<\/a><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>TL;DR: The Gamepad API can be a quirky thing. But if you\u2019re building Three.js-based interactive WebVR experiences you can just use this generic VRController.js and call it a\u00a0day. I\u2019ve been building virtual reality experiences with the WebVR API for some time now\u2014primarily for the HTC Vive, but the beauty of making virtual reality for the&#8230;<a class=\"moretag\" href=\"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/\"> Read the full article&#8230;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[15],"tags":[],"class_list":["post-32247","post","type-post","status-publish","format-standard","hentry","category-general-info"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"TL;DR: The Gamepad API can be a quirky thing. But if you\u2019re building Three.js-based interactive WebVR experiences you can just use this generic VRController.js and call it a day.I\u2019ve been building virtual reality experiences with the WebVR API for some time now\u2014primarily for the HTC Vive, but the beauty of making virtual reality for the Web\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Guest Contribution\"\/>\n\t<meta name=\"keywords\" content=\"general info\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Design for Immersive Technologies | User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"WebVR controllers and Chromium\u2019s Gamepad API. | Design for Immersive Technologies\" \/>\n\t\t<meta property=\"og:description\" content=\"TL;DR: The Gamepad API can be a quirky thing. But if you\u2019re building Three.js-based interactive WebVR experiences you can just use this generic VRController.js and call it a day.I\u2019ve been building virtual reality experiences with the WebVR API for some time now\u2014primarily for the HTC Vive, but the beauty of making virtual reality for the Web\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2017-06-14T01:27:49+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2017-06-14T01:27:49+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"WebVR controllers and Chromium\u2019s Gamepad API. | Design for Immersive Technologies\" \/>\n\t\t<meta name=\"twitter:description\" content=\"TL;DR: The Gamepad API can be a quirky thing. But if you\u2019re building Three.js-based interactive WebVR experiences you can just use this generic VRController.js and call it a day.I\u2019ve been building virtual reality experiences with the WebVR API for some time now\u2014primarily for the HTC Vive, but the beauty of making virtual reality for the Web\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/webvr-controllers-and-chromiums-gamepad-api\\\/#article\",\"name\":\"WebVR controllers and Chromium\\u2019s Gamepad API. | Design for Immersive Technologies\",\"headline\":\"WebVR controllers and Chromium\\u2019s Gamepad API.\",\"author\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"http:\\\/\\\/www.taterboy.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/12AxwXq_cvZL0fcrDJ9ikITcA.jpeg\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/webvr-controllers-and-chromiums-gamepad-api\\\/#articleImage\"},\"datePublished\":\"2017-06-13T18:27:49-07:00\",\"dateModified\":\"2017-06-13T18:27:49-07:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/webvr-controllers-and-chromiums-gamepad-api\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/webvr-controllers-and-chromiums-gamepad-api\\\/#webpage\"},\"articleSection\":\"General Info\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/webvr-controllers-and-chromiums-gamepad-api\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.taterboy.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/general-info\\\/#listItem\",\"name\":\"General Info\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/general-info\\\/#listItem\",\"position\":2,\"name\":\"General Info\",\"item\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/general-info\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/webvr-controllers-and-chromiums-gamepad-api\\\/#listItem\",\"name\":\"WebVR controllers and Chromium\\u2019s Gamepad API.\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/webvr-controllers-and-chromiums-gamepad-api\\\/#listItem\",\"position\":3,\"name\":\"WebVR controllers and Chromium\\u2019s Gamepad API.\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/general-info\\\/#listItem\",\"name\":\"General Info\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\",\"name\":\"Design for Immersive Technologies\",\"description\":\"User Experience for Games, Virtual Reality (VR) and Augmented\\\/Mixed Reality (AR\\\/MR)\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/\",\"name\":\"Guest Contribution\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/webvr-controllers-and-chromiums-gamepad-api\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d2aad73eb0f48c67b141e9fc978a0e498969791ed623346e361d02d19775b0bb?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Guest Contribution\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/webvr-controllers-and-chromiums-gamepad-api\\\/#webpage\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/webvr-controllers-and-chromiums-gamepad-api\\\/\",\"name\":\"WebVR controllers and Chromium\\u2019s Gamepad API. | Design for Immersive Technologies\",\"description\":\"TL;DR: The Gamepad API can be a quirky thing. But if you\\u2019re building Three.js-based interactive WebVR experiences you can just use this generic VRController.js and call it a day.I\\u2019ve been building virtual reality experiences with the WebVR API for some time now\\u2014primarily for the HTC Vive, but the beauty of making virtual reality for the Web\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/webvr-controllers-and-chromiums-gamepad-api\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"datePublished\":\"2017-06-13T18:27:49-07:00\",\"dateModified\":\"2017-06-13T18:27:49-07:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/\",\"name\":\"Design for Immersive Technologies\",\"description\":\"User Experience for Games, Virtual Reality (VR) and Augmented\\\/Mixed Reality (AR\\\/MR)\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"WebVR controllers and Chromium\u2019s Gamepad API. | Design for Immersive Technologies","description":"TL;DR: The Gamepad API can be a quirky thing. But if you\u2019re building Three.js-based interactive WebVR experiences you can just use this generic VRController.js and call it a day.I\u2019ve been building virtual reality experiences with the WebVR API for some time now\u2014primarily for the HTC Vive, but the beauty of making virtual reality for the Web","canonical_url":"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/","robots":"max-image-preview:large","keywords":"general info","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/#article","name":"WebVR controllers and Chromium\u2019s Gamepad API. | Design for Immersive Technologies","headline":"WebVR controllers and Chromium\u2019s Gamepad API.","author":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"publisher":{"@id":"https:\/\/www.taterboy.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2017\/06\/12AxwXq_cvZL0fcrDJ9ikITcA.jpeg","@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/#articleImage"},"datePublished":"2017-06-13T18:27:49-07:00","dateModified":"2017-06-13T18:27:49-07:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/#webpage"},"isPartOf":{"@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/#webpage"},"articleSection":"General Info"},{"@type":"BreadcrumbList","@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.taterboy.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/general-info\/#listItem","name":"General Info"}},{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/general-info\/#listItem","position":2,"name":"General Info","item":"https:\/\/www.taterboy.com\/blog\/category\/general-info\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/#listItem","name":"WebVR controllers and Chromium\u2019s Gamepad API."},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/#listItem","position":3,"name":"WebVR controllers and Chromium\u2019s Gamepad API.","previousItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/general-info\/#listItem","name":"General Info"}}]},{"@type":"Organization","@id":"https:\/\/www.taterboy.com\/blog\/#organization","name":"Design for Immersive Technologies","description":"User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","url":"https:\/\/www.taterboy.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author","url":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/","name":"Guest Contribution","image":{"@type":"ImageObject","@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/d2aad73eb0f48c67b141e9fc978a0e498969791ed623346e361d02d19775b0bb?s=96&d=mm&r=g","width":96,"height":96,"caption":"Guest Contribution"}},{"@type":"WebPage","@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/#webpage","url":"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/","name":"WebVR controllers and Chromium\u2019s Gamepad API. | Design for Immersive Technologies","description":"TL;DR: The Gamepad API can be a quirky thing. But if you\u2019re building Three.js-based interactive WebVR experiences you can just use this generic VRController.js and call it a day.I\u2019ve been building virtual reality experiences with the WebVR API for some time now\u2014primarily for the HTC Vive, but the beauty of making virtual reality for the Web","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.taterboy.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/#breadcrumblist"},"author":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"creator":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"datePublished":"2017-06-13T18:27:49-07:00","dateModified":"2017-06-13T18:27:49-07:00"},{"@type":"WebSite","@id":"https:\/\/www.taterboy.com\/blog\/#website","url":"https:\/\/www.taterboy.com\/blog\/","name":"Design for Immersive Technologies","description":"User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.taterboy.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Design for Immersive Technologies | User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","og:type":"article","og:title":"WebVR controllers and Chromium\u2019s Gamepad API. | Design for Immersive Technologies","og:description":"TL;DR: The Gamepad API can be a quirky thing. But if you\u2019re building Three.js-based interactive WebVR experiences you can just use this generic VRController.js and call it a day.I\u2019ve been building virtual reality experiences with the WebVR API for some time now\u2014primarily for the HTC Vive, but the beauty of making virtual reality for the Web","og:url":"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/","article:published_time":"2017-06-14T01:27:49+00:00","article:modified_time":"2017-06-14T01:27:49+00:00","twitter:card":"summary","twitter:title":"WebVR controllers and Chromium\u2019s Gamepad API. | Design for Immersive Technologies","twitter:description":"TL;DR: The Gamepad API can be a quirky thing. But if you\u2019re building Three.js-based interactive WebVR experiences you can just use this generic VRController.js and call it a day.I\u2019ve been building virtual reality experiences with the WebVR API for some time now\u2014primarily for the HTC Vive, but the beauty of making virtual reality for the Web"},"aioseo_meta_data":{"post_id":"32247","title":null,"description":null,"keywords":null,"keyphrases":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_custom_image_width":null,"og_custom_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"created":"2021-02-08 10:37:41","updated":"2026-08-30 09:53:45","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"twitter_image_url":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.taterboy.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.taterboy.com\/blog\/category\/general-info\/\" title=\"General Info\">General Info<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tWebVR controllers and Chromium\u2019s Gamepad API.\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.taterboy.com\/blog"},{"label":"General Info","link":"https:\/\/www.taterboy.com\/blog\/category\/general-info\/"},{"label":"WebVR controllers and Chromium\u2019s Gamepad API.","link":"https:\/\/www.taterboy.com\/blog\/2017\/06\/webvr-controllers-and-chromiums-gamepad-api\/"}],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8wzr5-8o7","jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts\/32247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/comments?post=32247"}],"version-history":[{"count":0,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts\/32247\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/media?parent=32247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/categories?post=32247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/tags?post=32247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}