{"id":200356,"date":"2015-04-22T06:51:13","date_gmt":"2015-04-22T13:51:13","guid":{"rendered":"http:\/\/css-tricks.com\/?p=200356"},"modified":"2017-04-10T18:30:40","modified_gmt":"2017-04-11T01:30:40","slug":"how-to-make-a-smartphone-controlled-3d-web-game","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/how-to-make-a-smartphone-controlled-3d-web-game\/","title":{"rendered":"How to Make a Smartphone Controlled 3D Web Game"},"content":{"rendered":"
The following is a guest post by Charlie Walter<\/a>. Charlie does a bunch of work with Three.js<\/a> (3D in the browser with WebGL) and gaming concepts. If that stuff interests you, read on!<\/em><\/p>\n In this tutorial I’ll explain an approach on how to connect your smartphone to a 3D web game. We’ll be making a car which you can control by tilting your phone (using the phone’s accelerometer). We’ll use the JavaScript library three.js<\/a> for working with WebGL as well as WebSockets<\/a> through the socket.io<\/a> library and a few other web technologies.<\/p>\n <\/p>\n Here’s the live demo<\/a> you can play with right now. Note that it works best on WiFi.<\/p>\nTry it now<\/h3>\n