For 20 years, the Web3D Consortium has developed and maintained a open, royalty free, ISO ratified and well documented standardized markup language for transmitting and displaying 3D content on the web called X3D.
Smart phones and tablets with recent releases of Chrome, Firefox, Safari, or Internet Explorer can display 3D models from the Web. These devices also have internal sensors that tell the browser about its orientation.
Not all mobile devices and browsers correctly report the device orientation. According the the World Wide Web Consortium (W3C) Working Draft 1 from December 2011 "DeviceOrientation Event Specification" the orientation is given by three angles representing compass direction (α), tilt (β), and rotation (γ). The 0 values for these is with the device flat, screen up, pointed North.