├── LICENSE ├── README.md ├── css ├── elevr-player.css ├── elevr-player.css.orig ├── font-awesome.css └── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ └── fontawesome-webfont.woff ├── elelogo-square.png ├── elevr-player.appcache ├── elevr-player.html ├── images ├── Greeley_pan_small_stars.jpg ├── denver-botanical-5-small.jpg ├── kirby-cove-1-small.jpg ├── mosaic-math-art.JPG ├── phone-stereo-test.jpg └── utrecht-canal.jpg ├── index.html ├── js ├── elevr-player.js ├── elevr-player.js.orig └── phonevr.js └── lib ├── gl-matrix.js └── util.js /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | eleVR Picture Player 2 | ================ 3 | 4 | The eleVR Picture Player lets you watch 360 flat and stereo equirectangular panoramas on your Oculus Rift, Android, or iPhone device with VR headset (Cardboard, Durovis Dive, etc.) from a web browser. It is written with js, html5, and webGL. It depends on the open source libraries as noted in the [3rd Party Libraries](https://github.com/hawksley/eleVR-Picture-Player/blob/master/README.md#3rd-party-libraries) section. 5 | 6 | eleVR Picture Player works with the native browser support currently being implemented by [Firefox](http://blog.bitops.com/blog/2014/06/26/first-steps-for-vr-on-the-web/) and [Chromium](https://drive.google.com/folderview?id=0BzudLt22BqGRbW9WTHMtOWMzNjQ&usp=sharing#list). 7 | 8 | The player is a fun fork of the [eleVR Web Player for web video](https://github.com/hawksley/eleVR-Web-Player) with some changes to optimize the player for showing panoramic pictures. 9 | 10 | Pictures shown in the player can be rotated using keyboard controls (a/d, w/s, and q/e), as well as by the Oculus Rift if you are running an experimental webVR browser. You may be able to decrease video judder by setting your Oculus Display refresh rate to 60 Hz (the browser refreshes at 60 Hz and the slower mismatch can cause judder). 11 | 12 | #### [Go check out the demo!](http://hawksley.github.io/eleVR-Picture-Player/) #### 13 | 14 | The following table documents the keyboard controls currently available. 15 | 16 | | Key | Control | 17 | |:-----:|-------------| 18 | | f | full screen webVR mode (with barrel distortion) | 19 | | g | regular full screen mode (less lag) | 20 | | w | up | 21 | | a | left | 22 | | s | down | 23 | | d | right | 24 | | q | rotate left | 25 | | e | rotate right | 26 | 27 | It currently only supports spherical panoramic pictures with equirectangular projections and spherical 3D panoramas with top/bottom equirectangular projections. 28 | 29 | ### Support ### 30 | Using keyboard rotation controls, the player works on standard Firefox and Chrome on Windows, Mac, and Linux. It also runs on Safari (if webgl is enabled). I haven't tested it on other browsers. 31 | 32 | Using Oculus headset controls, the player works on the experimental webVR builds of [Firefox](http://blog.bitops.com/blog/2014/06/26/first-steps-for-vr-on-the-web/) and [Chromium](https://drive.google.com/folderview?id=0BzudLt22BqGRbW9WTHMtOWMzNjQ&usp=sharing#list). 33 | 34 | Using device orientation controls, it works on Safari on iPhone and Chrome on Android devices. 35 | 36 | ## Running your own picture ## 37 | The easiest way to run your own picture is to click the folder icon and load your video from there. You may then need to choose the projection for your picture from the projection selector. 38 | 39 | You can load your own picture from the javascript console, by typing loadVideo("0myVideo.mp4"). If your video is equirectangular 2D, preface your picture by 0. If it is stereo top/bottom, preface it by 1. These numbers correspond to the projections in the projectionEnum declaration in elevr-player.js. 40 | 41 | If you want to add your picture to the drop-down, create a new option in the html picture-select element that looks like: 42 | 43 | 44 | If you want your picture to be the picture loaded initially, change the source of the picture in the html img tag with the id "pano-image". You can also update the starting projection, if necessary, by changing the value of the "projection" variable on instantiation (and also changing the default value of the projection-select html select tag. 45 | 46 | ## Possible Issues and Resolutions ## 47 | ###Oculus movement isn't being recognized### 48 | Make sure that you are using an experimental webVR version of the browser. If it still isn't being recognized, you can try restarting the browser and plugging/unplugging your device. 49 | 50 | ###Android or iPhone is not working### 51 | You may not be on a sufficiently recent version of Android or iOS. webGL support did not exist before Android 4.3 and iOS 8. 52 | 53 | ###My panorama isn't loading### 54 | Your image may exceed the max texture size of your device. This is likely to be 4096x4096, but you can check by going here: https://www.khronos.org/registry/webgl/conformance-suites/1.0.2/conformance/limits/gl-max-texture-dimensions.html 55 | 56 | ## Future Work ## 57 | The picture player is more of a fun diversion from the video player than a serious project of it's own. As such, there isn't that much extra work planned on it, other than occasionally updating it to match desirable features of the web player and potentially adding additional projections so as to be able to show cube map panoramas and similar. 58 | 59 | ## 3rd party libraries ## 60 | The following assets are used by the eleVR Player: 61 | 62 | - glMatrix - Similar to MIT License - http://glmatrix.net/ 63 | - Font Awesome - MIT License - http://fortawesome.github.io/Font-Awesome/ 64 | -------------------------------------------------------------------------------- /css/elevr-player.css: -------------------------------------------------------------------------------- 1 | /** 2 | * eleVR Web Player: A web player for 360 video on the Oculus 3 | * Copyright (C) 2014 Andrea Hawksley and Andrew Lutomirski 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | body { 21 | background-color: #000; 22 | font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; 23 | font-weight: 300; 24 | color: #FFF; 25 | margin: 0; 26 | padding: 0; 27 | overflow: hidden; 28 | } 29 | 30 | select { 31 | border: none; 32 | background: rgba(0,0,0,.6); 33 | color: rgba(255,255,255,.8); 34 | padding: 2px; 35 | border-radius: 3px; 36 | } 37 | 38 | a { 39 | cursor: pointer; 40 | color: rgba(0,0,0,.5); 41 | } 42 | 43 | a:hover { 44 | color: rgba(255,255,255,.65); 45 | } 46 | 47 | a:active { 48 | color: rgba(255,255,255,.8); 49 | text-shadow: 2px 2px 3px rgba(200,200,200,.9); 50 | } 51 | 52 | #picture-container { 53 | background-color: #000; 54 | } 55 | 56 | .left { 57 | width: 50%; 58 | float: left; 59 | position: relative; 60 | top: 43%; 61 | left: 2%; 62 | z-index: 1; 63 | } 64 | 65 | .right { 66 | width: 50%; 67 | float: right; 68 | position: relative; 69 | top: 43%; 70 | right: 2%; 71 | z-index: 1; 72 | } 73 | 74 | #glcanvas { 75 | position:absolute; 76 | top:0; bottom:0; right:0; left:0; 77 | } 78 | 79 | #picture-controls { 80 | position: fixed; 81 | bottom: 0; 82 | left: 0; 83 | right: 0; 84 | padding: 0 10px; 85 | opacity: .9; 86 | height: 30px; 87 | background-color: rgb(237,25,88); 88 | 89 | background: -webkit-linear-gradient(left top, rgb(190,25,141), rgb(237,25,88)); 90 | background: -o-linear-gradient(bottom right, rgb(190,25,141), rgb(237,25,88)); 91 | background: -moz-linear-gradient(bottom right, rgb(190,25,141), rgb(237,25,88)); 92 | background: linear-gradient(to bottom right, rgb(190,25,141), rgb(237,25,88)); 93 | } 94 | 95 | select { 96 | width: 12%; 97 | max-width: 300px; 98 | margin-right: 5px; 99 | } 100 | 101 | .icon { 102 | margin: 7px 5px 0px 5px; 103 | width:20px; 104 | float: left; 105 | } 106 | 107 | .rfloat { 108 | float: right; 109 | margin-top:5px; 110 | } 111 | 112 | .title, .message { 113 | text-align: center; 114 | margin: 0 auto; 115 | display: block; 116 | color: rgba(255,255,255,.5); 117 | } 118 | 119 | #pano-image { 120 | display: none; 121 | } 122 | -------------------------------------------------------------------------------- /css/elevr-player.css.orig: -------------------------------------------------------------------------------- 1 | /** 2 | * eleVR Web Player: A web player for 360 video on the Oculus 3 | * Copyright (C) 2014 Andrea Hawksley and Andrew Lutomirski 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | body { 21 | background-color: #000; 22 | font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; 23 | font-weight: 300; 24 | } 25 | 26 | <<<<<<< HEAD 27 | ======= 28 | select { 29 | border: none; 30 | background: rgba(0,0,0,.6); 31 | color: rgba(255,255,255,.8); 32 | padding: 2px; 33 | border-radius: 3px; 34 | } 35 | 36 | video { 37 | display: none; 38 | } 39 | 40 | a { 41 | cursor: pointer; 42 | color: rgba(0,0,0,.5); 43 | } 44 | 45 | a:hover { 46 | color: rgba(0,0,0,.65); 47 | } 48 | 49 | a:active { 50 | color: rgba(0,0,0,.8); 51 | text-shadow: 2px 2px 3px rgba(100,100,100,0.9); 52 | } 53 | 54 | >>>>>>> master 55 | #video-container { 56 | height:800px; 57 | width:1200px; 58 | background-color: #000; 59 | } 60 | 61 | <<<<<<< HEAD 62 | ======= 63 | #left { 64 | width: 50%; 65 | float: left; 66 | position: relative; 67 | top: 43%; 68 | left: 2%; 69 | } 70 | 71 | #right { 72 | width: 50%; 73 | float: right; 74 | position: relative; 75 | top: 43%; 76 | right: 2%; 77 | } 78 | 79 | #glcanvas { 80 | position:absolute; 81 | top:0; bottom:0; right:0; left:0; 82 | } 83 | 84 | >>>>>>> master 85 | #video-controls { 86 | position: fixed; 87 | bottom: 0; 88 | left: 0; 89 | right: 0; 90 | opacity: .9; 91 | height: 0px; 92 | -webkit-transition: all .4s ease; 93 | -moz-transition: all .4s ease; 94 | -o-transition: all .4s ease; 95 | -ms-transition: all .4s ease; 96 | transition: all .4s ease; 97 | background-color: rgb(237,25,88); 98 | 99 | background: -webkit-linear-gradient(left top, rgb(190,25,141), rgb(237,25,88)); 100 | background: -o-linear-gradient(bottom right, rgb(190,25,141), rgb(237,25,88)); 101 | background: -moz-linear-gradient(bottom right, rgb(190,25,141), rgb(237,25,88)); 102 | background: linear-gradient(to bottom right, rgb(190,25,141), rgb(237,25,88)); 103 | } 104 | 105 | #control-hover-area { 106 | position: fixed; 107 | bottom: 0; 108 | left: 0; 109 | right: 0; 110 | height:80px; 111 | } 112 | 113 | #control-hover-area:hover #video-controls { 114 | height: 25px; 115 | padding: 5px; 116 | -webkit-transition: all .5s ease; 117 | -moz-transition: all .5s ease; 118 | -o-transition: all .5s ease; 119 | -ms-transition: all .5s ease; 120 | transition: all .5s ease; 121 | } 122 | 123 | #seek-bar { 124 | width: 500px; 125 | } 126 | 127 | <<<<<<< HEAD 128 | #volume-bar { 129 | width: 60px; 130 | } 131 | 132 | a { 133 | cursor: pointer; 134 | color: rgba(0,0,0,.5); 135 | } 136 | 137 | a:hover { 138 | color: rgba(0,0,0,.65); 139 | } 140 | 141 | a:active { 142 | color: rgba(0,0,0,.8); 143 | text-shadow: 2px 2px 3px rgba(100,100,100,0.9); 144 | } 145 | 146 | ======= 147 | >>>>>>> master 148 | .icon { 149 | margin: 0px 5px; 150 | width:20px; 151 | } 152 | 153 | .rfloat { 154 | float: right; 155 | margin-top:5px; 156 | } 157 | 158 | <<<<<<< HEAD 159 | select { 160 | border: none; 161 | background: rgba(0,0,0,.6); 162 | color: rgba(255,255,255,.8); 163 | padding: 2px; 164 | border-radius: 3px; 165 | ======= 166 | .title { 167 | font-size: 54px; 168 | } 169 | 170 | .message { 171 | font-size: 36px; 172 | } 173 | 174 | .title, .message { 175 | text-align: center; 176 | color: white; 177 | >>>>>>> master 178 | } 179 | -------------------------------------------------------------------------------- /css/font-awesome.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | /* FONT PATH 6 | * -------------------------- */ 7 | @font-face { 8 | font-family: 'FontAwesome'; 9 | src: url('fonts/fontawesome-webfont.eot?v=4.0.3'); 10 | src: url('fonts/fontawesome-webfont.eot?#iefix&v=4.0.3') format('embedded-opentype'), url('fonts/fontawesome-webfont.woff?v=4.0.3') format('woff'), url('fonts/fontawesome-webfont.ttf?v=4.0.3') format('truetype'), url('fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular') format('svg'); 11 | font-weight: normal; 12 | font-style: normal; 13 | } 14 | .fa { 15 | display: inline-block; 16 | font-family: FontAwesome; 17 | font-style: normal; 18 | font-weight: normal; 19 | line-height: 1; 20 | -webkit-font-smoothing: antialiased; 21 | -moz-osx-font-smoothing: grayscale; 22 | } 23 | /* makes the font 33% larger relative to the icon container */ 24 | .fa-lg { 25 | font-size: 1.3333333333333333em; 26 | line-height: 0.75em; 27 | vertical-align: -15%; 28 | } 29 | .fa-2x { 30 | font-size: 2em; 31 | } 32 | .fa-3x { 33 | font-size: 3em; 34 | } 35 | .fa-4x { 36 | font-size: 4em; 37 | } 38 | .fa-5x { 39 | font-size: 5em; 40 | } 41 | .fa-fw { 42 | width: 1.2857142857142858em; 43 | text-align: center; 44 | } 45 | .fa-ul { 46 | padding-left: 0; 47 | margin-left: 2.142857142857143em; 48 | list-style-type: none; 49 | } 50 | .fa-ul > li { 51 | position: relative; 52 | } 53 | .fa-li { 54 | position: absolute; 55 | left: -2.142857142857143em; 56 | width: 2.142857142857143em; 57 | top: 0.14285714285714285em; 58 | text-align: center; 59 | } 60 | .fa-li.fa-lg { 61 | left: -1.8571428571428572em; 62 | } 63 | .fa-border { 64 | padding: .2em .25em .15em; 65 | border: solid 0.08em #eeeeee; 66 | border-radius: .1em; 67 | } 68 | .pull-right { 69 | float: right; 70 | } 71 | .pull-left { 72 | float: left; 73 | } 74 | .fa.pull-left { 75 | margin-right: .3em; 76 | } 77 | .fa.pull-right { 78 | margin-left: .3em; 79 | } 80 | .fa-spin { 81 | -webkit-animation: spin 2s infinite linear; 82 | -moz-animation: spin 2s infinite linear; 83 | -o-animation: spin 2s infinite linear; 84 | animation: spin 2s infinite linear; 85 | } 86 | @-moz-keyframes spin { 87 | 0% { 88 | -moz-transform: rotate(0deg); 89 | } 90 | 100% { 91 | -moz-transform: rotate(359deg); 92 | } 93 | } 94 | @-webkit-keyframes spin { 95 | 0% { 96 | -webkit-transform: rotate(0deg); 97 | } 98 | 100% { 99 | -webkit-transform: rotate(359deg); 100 | } 101 | } 102 | @-o-keyframes spin { 103 | 0% { 104 | -o-transform: rotate(0deg); 105 | } 106 | 100% { 107 | -o-transform: rotate(359deg); 108 | } 109 | } 110 | @-ms-keyframes spin { 111 | 0% { 112 | -ms-transform: rotate(0deg); 113 | } 114 | 100% { 115 | -ms-transform: rotate(359deg); 116 | } 117 | } 118 | @keyframes spin { 119 | 0% { 120 | transform: rotate(0deg); 121 | } 122 | 100% { 123 | transform: rotate(359deg); 124 | } 125 | } 126 | .fa-rotate-90 { 127 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); 128 | -webkit-transform: rotate(90deg); 129 | -moz-transform: rotate(90deg); 130 | -ms-transform: rotate(90deg); 131 | -o-transform: rotate(90deg); 132 | transform: rotate(90deg); 133 | } 134 | .fa-rotate-180 { 135 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); 136 | -webkit-transform: rotate(180deg); 137 | -moz-transform: rotate(180deg); 138 | -ms-transform: rotate(180deg); 139 | -o-transform: rotate(180deg); 140 | transform: rotate(180deg); 141 | } 142 | .fa-rotate-270 { 143 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); 144 | -webkit-transform: rotate(270deg); 145 | -moz-transform: rotate(270deg); 146 | -ms-transform: rotate(270deg); 147 | -o-transform: rotate(270deg); 148 | transform: rotate(270deg); 149 | } 150 | .fa-flip-horizontal { 151 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1); 152 | -webkit-transform: scale(-1, 1); 153 | -moz-transform: scale(-1, 1); 154 | -ms-transform: scale(-1, 1); 155 | -o-transform: scale(-1, 1); 156 | transform: scale(-1, 1); 157 | } 158 | .fa-flip-vertical { 159 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1); 160 | -webkit-transform: scale(1, -1); 161 | -moz-transform: scale(1, -1); 162 | -ms-transform: scale(1, -1); 163 | -o-transform: scale(1, -1); 164 | transform: scale(1, -1); 165 | } 166 | .fa-stack { 167 | position: relative; 168 | display: inline-block; 169 | width: 2em; 170 | height: 2em; 171 | line-height: 2em; 172 | vertical-align: middle; 173 | } 174 | .fa-stack-1x, 175 | .fa-stack-2x { 176 | position: absolute; 177 | left: 0; 178 | width: 100%; 179 | text-align: center; 180 | } 181 | .fa-stack-1x { 182 | line-height: inherit; 183 | } 184 | .fa-stack-2x { 185 | font-size: 2em; 186 | } 187 | .fa-inverse { 188 | color: #ffffff; 189 | } 190 | /* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen 191 | readers do not read off random characters that represent icons */ 192 | .fa-glass:before { 193 | content: "\f000"; 194 | } 195 | .fa-music:before { 196 | content: "\f001"; 197 | } 198 | .fa-search:before { 199 | content: "\f002"; 200 | } 201 | .fa-envelope-o:before { 202 | content: "\f003"; 203 | } 204 | .fa-heart:before { 205 | content: "\f004"; 206 | } 207 | .fa-star:before { 208 | content: "\f005"; 209 | } 210 | .fa-star-o:before { 211 | content: "\f006"; 212 | } 213 | .fa-user:before { 214 | content: "\f007"; 215 | } 216 | .fa-film:before { 217 | content: "\f008"; 218 | } 219 | .fa-th-large:before { 220 | content: "\f009"; 221 | } 222 | .fa-th:before { 223 | content: "\f00a"; 224 | } 225 | .fa-th-list:before { 226 | content: "\f00b"; 227 | } 228 | .fa-check:before { 229 | content: "\f00c"; 230 | } 231 | .fa-times:before { 232 | content: "\f00d"; 233 | } 234 | .fa-search-plus:before { 235 | content: "\f00e"; 236 | } 237 | .fa-search-minus:before { 238 | content: "\f010"; 239 | } 240 | .fa-power-off:before { 241 | content: "\f011"; 242 | } 243 | .fa-signal:before { 244 | content: "\f012"; 245 | } 246 | .fa-gear:before, 247 | .fa-cog:before { 248 | content: "\f013"; 249 | } 250 | .fa-trash-o:before { 251 | content: "\f014"; 252 | } 253 | .fa-home:before { 254 | content: "\f015"; 255 | } 256 | .fa-file-o:before { 257 | content: "\f016"; 258 | } 259 | .fa-clock-o:before { 260 | content: "\f017"; 261 | } 262 | .fa-road:before { 263 | content: "\f018"; 264 | } 265 | .fa-download:before { 266 | content: "\f019"; 267 | } 268 | .fa-arrow-circle-o-down:before { 269 | content: "\f01a"; 270 | } 271 | .fa-arrow-circle-o-up:before { 272 | content: "\f01b"; 273 | } 274 | .fa-inbox:before { 275 | content: "\f01c"; 276 | } 277 | .fa-play-circle-o:before { 278 | content: "\f01d"; 279 | } 280 | .fa-rotate-right:before, 281 | .fa-repeat:before { 282 | content: "\f01e"; 283 | } 284 | .fa-refresh:before { 285 | content: "\f021"; 286 | } 287 | .fa-list-alt:before { 288 | content: "\f022"; 289 | } 290 | .fa-lock:before { 291 | content: "\f023"; 292 | } 293 | .fa-flag:before { 294 | content: "\f024"; 295 | } 296 | .fa-headphones:before { 297 | content: "\f025"; 298 | } 299 | .fa-volume-off:before { 300 | content: "\f026"; 301 | } 302 | .fa-volume-down:before { 303 | content: "\f027"; 304 | } 305 | .fa-volume-up:before { 306 | content: "\f028"; 307 | } 308 | .fa-qrcode:before { 309 | content: "\f029"; 310 | } 311 | .fa-barcode:before { 312 | content: "\f02a"; 313 | } 314 | .fa-tag:before { 315 | content: "\f02b"; 316 | } 317 | .fa-tags:before { 318 | content: "\f02c"; 319 | } 320 | .fa-book:before { 321 | content: "\f02d"; 322 | } 323 | .fa-bookmark:before { 324 | content: "\f02e"; 325 | } 326 | .fa-print:before { 327 | content: "\f02f"; 328 | } 329 | .fa-camera:before { 330 | content: "\f030"; 331 | } 332 | .fa-font:before { 333 | content: "\f031"; 334 | } 335 | .fa-bold:before { 336 | content: "\f032"; 337 | } 338 | .fa-italic:before { 339 | content: "\f033"; 340 | } 341 | .fa-text-height:before { 342 | content: "\f034"; 343 | } 344 | .fa-text-width:before { 345 | content: "\f035"; 346 | } 347 | .fa-align-left:before { 348 | content: "\f036"; 349 | } 350 | .fa-align-center:before { 351 | content: "\f037"; 352 | } 353 | .fa-align-right:before { 354 | content: "\f038"; 355 | } 356 | .fa-align-justify:before { 357 | content: "\f039"; 358 | } 359 | .fa-list:before { 360 | content: "\f03a"; 361 | } 362 | .fa-dedent:before, 363 | .fa-outdent:before { 364 | content: "\f03b"; 365 | } 366 | .fa-indent:before { 367 | content: "\f03c"; 368 | } 369 | .fa-video-camera:before { 370 | content: "\f03d"; 371 | } 372 | .fa-picture-o:before { 373 | content: "\f03e"; 374 | } 375 | .fa-pencil:before { 376 | content: "\f040"; 377 | } 378 | .fa-map-marker:before { 379 | content: "\f041"; 380 | } 381 | .fa-adjust:before { 382 | content: "\f042"; 383 | } 384 | .fa-tint:before { 385 | content: "\f043"; 386 | } 387 | .fa-edit:before, 388 | .fa-pencil-square-o:before { 389 | content: "\f044"; 390 | } 391 | .fa-share-square-o:before { 392 | content: "\f045"; 393 | } 394 | .fa-check-square-o:before { 395 | content: "\f046"; 396 | } 397 | .fa-arrows:before { 398 | content: "\f047"; 399 | } 400 | .fa-step-backward:before { 401 | content: "\f048"; 402 | } 403 | .fa-fast-backward:before { 404 | content: "\f049"; 405 | } 406 | .fa-backward:before { 407 | content: "\f04a"; 408 | } 409 | .fa-play:before { 410 | content: "\f04b"; 411 | } 412 | .fa-pause:before { 413 | content: "\f04c"; 414 | } 415 | .fa-stop:before { 416 | content: "\f04d"; 417 | } 418 | .fa-forward:before { 419 | content: "\f04e"; 420 | } 421 | .fa-fast-forward:before { 422 | content: "\f050"; 423 | } 424 | .fa-step-forward:before { 425 | content: "\f051"; 426 | } 427 | .fa-eject:before { 428 | content: "\f052"; 429 | } 430 | .fa-chevron-left:before { 431 | content: "\f053"; 432 | } 433 | .fa-chevron-right:before { 434 | content: "\f054"; 435 | } 436 | .fa-plus-circle:before { 437 | content: "\f055"; 438 | } 439 | .fa-minus-circle:before { 440 | content: "\f056"; 441 | } 442 | .fa-times-circle:before { 443 | content: "\f057"; 444 | } 445 | .fa-check-circle:before { 446 | content: "\f058"; 447 | } 448 | .fa-question-circle:before { 449 | content: "\f059"; 450 | } 451 | .fa-info-circle:before { 452 | content: "\f05a"; 453 | } 454 | .fa-crosshairs:before { 455 | content: "\f05b"; 456 | } 457 | .fa-times-circle-o:before { 458 | content: "\f05c"; 459 | } 460 | .fa-check-circle-o:before { 461 | content: "\f05d"; 462 | } 463 | .fa-ban:before { 464 | content: "\f05e"; 465 | } 466 | .fa-arrow-left:before { 467 | content: "\f060"; 468 | } 469 | .fa-arrow-right:before { 470 | content: "\f061"; 471 | } 472 | .fa-arrow-up:before { 473 | content: "\f062"; 474 | } 475 | .fa-arrow-down:before { 476 | content: "\f063"; 477 | } 478 | .fa-mail-forward:before, 479 | .fa-share:before { 480 | content: "\f064"; 481 | } 482 | .fa-expand:before { 483 | content: "\f065"; 484 | } 485 | .fa-compress:before { 486 | content: "\f066"; 487 | } 488 | .fa-plus:before { 489 | content: "\f067"; 490 | } 491 | .fa-minus:before { 492 | content: "\f068"; 493 | } 494 | .fa-asterisk:before { 495 | content: "\f069"; 496 | } 497 | .fa-exclamation-circle:before { 498 | content: "\f06a"; 499 | } 500 | .fa-gift:before { 501 | content: "\f06b"; 502 | } 503 | .fa-leaf:before { 504 | content: "\f06c"; 505 | } 506 | .fa-fire:before { 507 | content: "\f06d"; 508 | } 509 | .fa-eye:before { 510 | content: "\f06e"; 511 | } 512 | .fa-eye-slash:before { 513 | content: "\f070"; 514 | } 515 | .fa-warning:before, 516 | .fa-exclamation-triangle:before { 517 | content: "\f071"; 518 | } 519 | .fa-plane:before { 520 | content: "\f072"; 521 | } 522 | .fa-calendar:before { 523 | content: "\f073"; 524 | } 525 | .fa-random:before { 526 | content: "\f074"; 527 | } 528 | .fa-comment:before { 529 | content: "\f075"; 530 | } 531 | .fa-magnet:before { 532 | content: "\f076"; 533 | } 534 | .fa-chevron-up:before { 535 | content: "\f077"; 536 | } 537 | .fa-chevron-down:before { 538 | content: "\f078"; 539 | } 540 | .fa-retweet:before { 541 | content: "\f079"; 542 | } 543 | .fa-shopping-cart:before { 544 | content: "\f07a"; 545 | } 546 | .fa-folder:before { 547 | content: "\f07b"; 548 | } 549 | .fa-folder-open:before { 550 | content: "\f07c"; 551 | } 552 | .fa-arrows-v:before { 553 | content: "\f07d"; 554 | } 555 | .fa-arrows-h:before { 556 | content: "\f07e"; 557 | } 558 | .fa-bar-chart-o:before { 559 | content: "\f080"; 560 | } 561 | .fa-twitter-square:before { 562 | content: "\f081"; 563 | } 564 | .fa-facebook-square:before { 565 | content: "\f082"; 566 | } 567 | .fa-camera-retro:before { 568 | content: "\f083"; 569 | } 570 | .fa-key:before { 571 | content: "\f084"; 572 | } 573 | .fa-gears:before, 574 | .fa-cogs:before { 575 | content: "\f085"; 576 | } 577 | .fa-comments:before { 578 | content: "\f086"; 579 | } 580 | .fa-thumbs-o-up:before { 581 | content: "\f087"; 582 | } 583 | .fa-thumbs-o-down:before { 584 | content: "\f088"; 585 | } 586 | .fa-star-half:before { 587 | content: "\f089"; 588 | } 589 | .fa-heart-o:before { 590 | content: "\f08a"; 591 | } 592 | .fa-sign-out:before { 593 | content: "\f08b"; 594 | } 595 | .fa-linkedin-square:before { 596 | content: "\f08c"; 597 | } 598 | .fa-thumb-tack:before { 599 | content: "\f08d"; 600 | } 601 | .fa-external-link:before { 602 | content: "\f08e"; 603 | } 604 | .fa-sign-in:before { 605 | content: "\f090"; 606 | } 607 | .fa-trophy:before { 608 | content: "\f091"; 609 | } 610 | .fa-github-square:before { 611 | content: "\f092"; 612 | } 613 | .fa-upload:before { 614 | content: "\f093"; 615 | } 616 | .fa-lemon-o:before { 617 | content: "\f094"; 618 | } 619 | .fa-phone:before { 620 | content: "\f095"; 621 | } 622 | .fa-square-o:before { 623 | content: "\f096"; 624 | } 625 | .fa-bookmark-o:before { 626 | content: "\f097"; 627 | } 628 | .fa-phone-square:before { 629 | content: "\f098"; 630 | } 631 | .fa-twitter:before { 632 | content: "\f099"; 633 | } 634 | .fa-facebook:before { 635 | content: "\f09a"; 636 | } 637 | .fa-github:before { 638 | content: "\f09b"; 639 | } 640 | .fa-unlock:before { 641 | content: "\f09c"; 642 | } 643 | .fa-credit-card:before { 644 | content: "\f09d"; 645 | } 646 | .fa-rss:before { 647 | content: "\f09e"; 648 | } 649 | .fa-hdd-o:before { 650 | content: "\f0a0"; 651 | } 652 | .fa-bullhorn:before { 653 | content: "\f0a1"; 654 | } 655 | .fa-bell:before { 656 | content: "\f0f3"; 657 | } 658 | .fa-certificate:before { 659 | content: "\f0a3"; 660 | } 661 | .fa-hand-o-right:before { 662 | content: "\f0a4"; 663 | } 664 | .fa-hand-o-left:before { 665 | content: "\f0a5"; 666 | } 667 | .fa-hand-o-up:before { 668 | content: "\f0a6"; 669 | } 670 | .fa-hand-o-down:before { 671 | content: "\f0a7"; 672 | } 673 | .fa-arrow-circle-left:before { 674 | content: "\f0a8"; 675 | } 676 | .fa-arrow-circle-right:before { 677 | content: "\f0a9"; 678 | } 679 | .fa-arrow-circle-up:before { 680 | content: "\f0aa"; 681 | } 682 | .fa-arrow-circle-down:before { 683 | content: "\f0ab"; 684 | } 685 | .fa-globe:before { 686 | content: "\f0ac"; 687 | } 688 | .fa-wrench:before { 689 | content: "\f0ad"; 690 | } 691 | .fa-tasks:before { 692 | content: "\f0ae"; 693 | } 694 | .fa-filter:before { 695 | content: "\f0b0"; 696 | } 697 | .fa-briefcase:before { 698 | content: "\f0b1"; 699 | } 700 | .fa-arrows-alt:before { 701 | content: "\f0b2"; 702 | } 703 | .fa-group:before, 704 | .fa-users:before { 705 | content: "\f0c0"; 706 | } 707 | .fa-chain:before, 708 | .fa-link:before { 709 | content: "\f0c1"; 710 | } 711 | .fa-cloud:before { 712 | content: "\f0c2"; 713 | } 714 | .fa-flask:before { 715 | content: "\f0c3"; 716 | } 717 | .fa-cut:before, 718 | .fa-scissors:before { 719 | content: "\f0c4"; 720 | } 721 | .fa-copy:before, 722 | .fa-files-o:before { 723 | content: "\f0c5"; 724 | } 725 | .fa-paperclip:before { 726 | content: "\f0c6"; 727 | } 728 | .fa-save:before, 729 | .fa-floppy-o:before { 730 | content: "\f0c7"; 731 | } 732 | .fa-square:before { 733 | content: "\f0c8"; 734 | } 735 | .fa-bars:before { 736 | content: "\f0c9"; 737 | } 738 | .fa-list-ul:before { 739 | content: "\f0ca"; 740 | } 741 | .fa-list-ol:before { 742 | content: "\f0cb"; 743 | } 744 | .fa-strikethrough:before { 745 | content: "\f0cc"; 746 | } 747 | .fa-underline:before { 748 | content: "\f0cd"; 749 | } 750 | .fa-table:before { 751 | content: "\f0ce"; 752 | } 753 | .fa-magic:before { 754 | content: "\f0d0"; 755 | } 756 | .fa-truck:before { 757 | content: "\f0d1"; 758 | } 759 | .fa-pinterest:before { 760 | content: "\f0d2"; 761 | } 762 | .fa-pinterest-square:before { 763 | content: "\f0d3"; 764 | } 765 | .fa-google-plus-square:before { 766 | content: "\f0d4"; 767 | } 768 | .fa-google-plus:before { 769 | content: "\f0d5"; 770 | } 771 | .fa-money:before { 772 | content: "\f0d6"; 773 | } 774 | .fa-caret-down:before { 775 | content: "\f0d7"; 776 | } 777 | .fa-caret-up:before { 778 | content: "\f0d8"; 779 | } 780 | .fa-caret-left:before { 781 | content: "\f0d9"; 782 | } 783 | .fa-caret-right:before { 784 | content: "\f0da"; 785 | } 786 | .fa-columns:before { 787 | content: "\f0db"; 788 | } 789 | .fa-unsorted:before, 790 | .fa-sort:before { 791 | content: "\f0dc"; 792 | } 793 | .fa-sort-down:before, 794 | .fa-sort-asc:before { 795 | content: "\f0dd"; 796 | } 797 | .fa-sort-up:before, 798 | .fa-sort-desc:before { 799 | content: "\f0de"; 800 | } 801 | .fa-envelope:before { 802 | content: "\f0e0"; 803 | } 804 | .fa-linkedin:before { 805 | content: "\f0e1"; 806 | } 807 | .fa-rotate-left:before, 808 | .fa-undo:before { 809 | content: "\f0e2"; 810 | } 811 | .fa-legal:before, 812 | .fa-gavel:before { 813 | content: "\f0e3"; 814 | } 815 | .fa-dashboard:before, 816 | .fa-tachometer:before { 817 | content: "\f0e4"; 818 | } 819 | .fa-comment-o:before { 820 | content: "\f0e5"; 821 | } 822 | .fa-comments-o:before { 823 | content: "\f0e6"; 824 | } 825 | .fa-flash:before, 826 | .fa-bolt:before { 827 | content: "\f0e7"; 828 | } 829 | .fa-sitemap:before { 830 | content: "\f0e8"; 831 | } 832 | .fa-umbrella:before { 833 | content: "\f0e9"; 834 | } 835 | .fa-paste:before, 836 | .fa-clipboard:before { 837 | content: "\f0ea"; 838 | } 839 | .fa-lightbulb-o:before { 840 | content: "\f0eb"; 841 | } 842 | .fa-exchange:before { 843 | content: "\f0ec"; 844 | } 845 | .fa-cloud-download:before { 846 | content: "\f0ed"; 847 | } 848 | .fa-cloud-upload:before { 849 | content: "\f0ee"; 850 | } 851 | .fa-user-md:before { 852 | content: "\f0f0"; 853 | } 854 | .fa-stethoscope:before { 855 | content: "\f0f1"; 856 | } 857 | .fa-suitcase:before { 858 | content: "\f0f2"; 859 | } 860 | .fa-bell-o:before { 861 | content: "\f0a2"; 862 | } 863 | .fa-coffee:before { 864 | content: "\f0f4"; 865 | } 866 | .fa-cutlery:before { 867 | content: "\f0f5"; 868 | } 869 | .fa-file-text-o:before { 870 | content: "\f0f6"; 871 | } 872 | .fa-building-o:before { 873 | content: "\f0f7"; 874 | } 875 | .fa-hospital-o:before { 876 | content: "\f0f8"; 877 | } 878 | .fa-ambulance:before { 879 | content: "\f0f9"; 880 | } 881 | .fa-medkit:before { 882 | content: "\f0fa"; 883 | } 884 | .fa-fighter-jet:before { 885 | content: "\f0fb"; 886 | } 887 | .fa-beer:before { 888 | content: "\f0fc"; 889 | } 890 | .fa-h-square:before { 891 | content: "\f0fd"; 892 | } 893 | .fa-plus-square:before { 894 | content: "\f0fe"; 895 | } 896 | .fa-angle-double-left:before { 897 | content: "\f100"; 898 | } 899 | .fa-angle-double-right:before { 900 | content: "\f101"; 901 | } 902 | .fa-angle-double-up:before { 903 | content: "\f102"; 904 | } 905 | .fa-angle-double-down:before { 906 | content: "\f103"; 907 | } 908 | .fa-angle-left:before { 909 | content: "\f104"; 910 | } 911 | .fa-angle-right:before { 912 | content: "\f105"; 913 | } 914 | .fa-angle-up:before { 915 | content: "\f106"; 916 | } 917 | .fa-angle-down:before { 918 | content: "\f107"; 919 | } 920 | .fa-desktop:before { 921 | content: "\f108"; 922 | } 923 | .fa-laptop:before { 924 | content: "\f109"; 925 | } 926 | .fa-tablet:before { 927 | content: "\f10a"; 928 | } 929 | .fa-mobile-phone:before, 930 | .fa-mobile:before { 931 | content: "\f10b"; 932 | } 933 | .fa-circle-o:before { 934 | content: "\f10c"; 935 | } 936 | .fa-quote-left:before { 937 | content: "\f10d"; 938 | } 939 | .fa-quote-right:before { 940 | content: "\f10e"; 941 | } 942 | .fa-spinner:before { 943 | content: "\f110"; 944 | } 945 | .fa-circle:before { 946 | content: "\f111"; 947 | } 948 | .fa-mail-reply:before, 949 | .fa-reply:before { 950 | content: "\f112"; 951 | } 952 | .fa-github-alt:before { 953 | content: "\f113"; 954 | } 955 | .fa-folder-o:before { 956 | content: "\f114"; 957 | } 958 | .fa-folder-open-o:before { 959 | content: "\f115"; 960 | } 961 | .fa-smile-o:before { 962 | content: "\f118"; 963 | } 964 | .fa-frown-o:before { 965 | content: "\f119"; 966 | } 967 | .fa-meh-o:before { 968 | content: "\f11a"; 969 | } 970 | .fa-gamepad:before { 971 | content: "\f11b"; 972 | } 973 | .fa-keyboard-o:before { 974 | content: "\f11c"; 975 | } 976 | .fa-flag-o:before { 977 | content: "\f11d"; 978 | } 979 | .fa-flag-checkered:before { 980 | content: "\f11e"; 981 | } 982 | .fa-terminal:before { 983 | content: "\f120"; 984 | } 985 | .fa-code:before { 986 | content: "\f121"; 987 | } 988 | .fa-reply-all:before { 989 | content: "\f122"; 990 | } 991 | .fa-mail-reply-all:before { 992 | content: "\f122"; 993 | } 994 | .fa-star-half-empty:before, 995 | .fa-star-half-full:before, 996 | .fa-star-half-o:before { 997 | content: "\f123"; 998 | } 999 | .fa-location-arrow:before { 1000 | content: "\f124"; 1001 | } 1002 | .fa-crop:before { 1003 | content: "\f125"; 1004 | } 1005 | .fa-code-fork:before { 1006 | content: "\f126"; 1007 | } 1008 | .fa-unlink:before, 1009 | .fa-chain-broken:before { 1010 | content: "\f127"; 1011 | } 1012 | .fa-question:before { 1013 | content: "\f128"; 1014 | } 1015 | .fa-info:before { 1016 | content: "\f129"; 1017 | } 1018 | .fa-exclamation:before { 1019 | content: "\f12a"; 1020 | } 1021 | .fa-superscript:before { 1022 | content: "\f12b"; 1023 | } 1024 | .fa-subscript:before { 1025 | content: "\f12c"; 1026 | } 1027 | .fa-eraser:before { 1028 | content: "\f12d"; 1029 | } 1030 | .fa-puzzle-piece:before { 1031 | content: "\f12e"; 1032 | } 1033 | .fa-microphone:before { 1034 | content: "\f130"; 1035 | } 1036 | .fa-microphone-slash:before { 1037 | content: "\f131"; 1038 | } 1039 | .fa-shield:before { 1040 | content: "\f132"; 1041 | } 1042 | .fa-calendar-o:before { 1043 | content: "\f133"; 1044 | } 1045 | .fa-fire-extinguisher:before { 1046 | content: "\f134"; 1047 | } 1048 | .fa-rocket:before { 1049 | content: "\f135"; 1050 | } 1051 | .fa-maxcdn:before { 1052 | content: "\f136"; 1053 | } 1054 | .fa-chevron-circle-left:before { 1055 | content: "\f137"; 1056 | } 1057 | .fa-chevron-circle-right:before { 1058 | content: "\f138"; 1059 | } 1060 | .fa-chevron-circle-up:before { 1061 | content: "\f139"; 1062 | } 1063 | .fa-chevron-circle-down:before { 1064 | content: "\f13a"; 1065 | } 1066 | .fa-html5:before { 1067 | content: "\f13b"; 1068 | } 1069 | .fa-css3:before { 1070 | content: "\f13c"; 1071 | } 1072 | .fa-anchor:before { 1073 | content: "\f13d"; 1074 | } 1075 | .fa-unlock-alt:before { 1076 | content: "\f13e"; 1077 | } 1078 | .fa-bullseye:before { 1079 | content: "\f140"; 1080 | } 1081 | .fa-ellipsis-h:before { 1082 | content: "\f141"; 1083 | } 1084 | .fa-ellipsis-v:before { 1085 | content: "\f142"; 1086 | } 1087 | .fa-rss-square:before { 1088 | content: "\f143"; 1089 | } 1090 | .fa-play-circle:before { 1091 | content: "\f144"; 1092 | } 1093 | .fa-ticket:before { 1094 | content: "\f145"; 1095 | } 1096 | .fa-minus-square:before { 1097 | content: "\f146"; 1098 | } 1099 | .fa-minus-square-o:before { 1100 | content: "\f147"; 1101 | } 1102 | .fa-level-up:before { 1103 | content: "\f148"; 1104 | } 1105 | .fa-level-down:before { 1106 | content: "\f149"; 1107 | } 1108 | .fa-check-square:before { 1109 | content: "\f14a"; 1110 | } 1111 | .fa-pencil-square:before { 1112 | content: "\f14b"; 1113 | } 1114 | .fa-external-link-square:before { 1115 | content: "\f14c"; 1116 | } 1117 | .fa-share-square:before { 1118 | content: "\f14d"; 1119 | } 1120 | .fa-compass:before { 1121 | content: "\f14e"; 1122 | } 1123 | .fa-toggle-down:before, 1124 | .fa-caret-square-o-down:before { 1125 | content: "\f150"; 1126 | } 1127 | .fa-toggle-up:before, 1128 | .fa-caret-square-o-up:before { 1129 | content: "\f151"; 1130 | } 1131 | .fa-toggle-right:before, 1132 | .fa-caret-square-o-right:before { 1133 | content: "\f152"; 1134 | } 1135 | .fa-euro:before, 1136 | .fa-eur:before { 1137 | content: "\f153"; 1138 | } 1139 | .fa-gbp:before { 1140 | content: "\f154"; 1141 | } 1142 | .fa-dollar:before, 1143 | .fa-usd:before { 1144 | content: "\f155"; 1145 | } 1146 | .fa-rupee:before, 1147 | .fa-inr:before { 1148 | content: "\f156"; 1149 | } 1150 | .fa-cny:before, 1151 | .fa-rmb:before, 1152 | .fa-yen:before, 1153 | .fa-jpy:before { 1154 | content: "\f157"; 1155 | } 1156 | .fa-ruble:before, 1157 | .fa-rouble:before, 1158 | .fa-rub:before { 1159 | content: "\f158"; 1160 | } 1161 | .fa-won:before, 1162 | .fa-krw:before { 1163 | content: "\f159"; 1164 | } 1165 | .fa-bitcoin:before, 1166 | .fa-btc:before { 1167 | content: "\f15a"; 1168 | } 1169 | .fa-file:before { 1170 | content: "\f15b"; 1171 | } 1172 | .fa-file-text:before { 1173 | content: "\f15c"; 1174 | } 1175 | .fa-sort-alpha-asc:before { 1176 | content: "\f15d"; 1177 | } 1178 | .fa-sort-alpha-desc:before { 1179 | content: "\f15e"; 1180 | } 1181 | .fa-sort-amount-asc:before { 1182 | content: "\f160"; 1183 | } 1184 | .fa-sort-amount-desc:before { 1185 | content: "\f161"; 1186 | } 1187 | .fa-sort-numeric-asc:before { 1188 | content: "\f162"; 1189 | } 1190 | .fa-sort-numeric-desc:before { 1191 | content: "\f163"; 1192 | } 1193 | .fa-thumbs-up:before { 1194 | content: "\f164"; 1195 | } 1196 | .fa-thumbs-down:before { 1197 | content: "\f165"; 1198 | } 1199 | .fa-youtube-square:before { 1200 | content: "\f166"; 1201 | } 1202 | .fa-youtube:before { 1203 | content: "\f167"; 1204 | } 1205 | .fa-xing:before { 1206 | content: "\f168"; 1207 | } 1208 | .fa-xing-square:before { 1209 | content: "\f169"; 1210 | } 1211 | .fa-youtube-play:before { 1212 | content: "\f16a"; 1213 | } 1214 | .fa-dropbox:before { 1215 | content: "\f16b"; 1216 | } 1217 | .fa-stack-overflow:before { 1218 | content: "\f16c"; 1219 | } 1220 | .fa-instagram:before { 1221 | content: "\f16d"; 1222 | } 1223 | .fa-flickr:before { 1224 | content: "\f16e"; 1225 | } 1226 | .fa-adn:before { 1227 | content: "\f170"; 1228 | } 1229 | .fa-bitbucket:before { 1230 | content: "\f171"; 1231 | } 1232 | .fa-bitbucket-square:before { 1233 | content: "\f172"; 1234 | } 1235 | .fa-tumblr:before { 1236 | content: "\f173"; 1237 | } 1238 | .fa-tumblr-square:before { 1239 | content: "\f174"; 1240 | } 1241 | .fa-long-arrow-down:before { 1242 | content: "\f175"; 1243 | } 1244 | .fa-long-arrow-up:before { 1245 | content: "\f176"; 1246 | } 1247 | .fa-long-arrow-left:before { 1248 | content: "\f177"; 1249 | } 1250 | .fa-long-arrow-right:before { 1251 | content: "\f178"; 1252 | } 1253 | .fa-apple:before { 1254 | content: "\f179"; 1255 | } 1256 | .fa-windows:before { 1257 | content: "\f17a"; 1258 | } 1259 | .fa-android:before { 1260 | content: "\f17b"; 1261 | } 1262 | .fa-linux:before { 1263 | content: "\f17c"; 1264 | } 1265 | .fa-dribbble:before { 1266 | content: "\f17d"; 1267 | } 1268 | .fa-skype:before { 1269 | content: "\f17e"; 1270 | } 1271 | .fa-foursquare:before { 1272 | content: "\f180"; 1273 | } 1274 | .fa-trello:before { 1275 | content: "\f181"; 1276 | } 1277 | .fa-female:before { 1278 | content: "\f182"; 1279 | } 1280 | .fa-male:before { 1281 | content: "\f183"; 1282 | } 1283 | .fa-gittip:before { 1284 | content: "\f184"; 1285 | } 1286 | .fa-sun-o:before { 1287 | content: "\f185"; 1288 | } 1289 | .fa-moon-o:before { 1290 | content: "\f186"; 1291 | } 1292 | .fa-archive:before { 1293 | content: "\f187"; 1294 | } 1295 | .fa-bug:before { 1296 | content: "\f188"; 1297 | } 1298 | .fa-vk:before { 1299 | content: "\f189"; 1300 | } 1301 | .fa-weibo:before { 1302 | content: "\f18a"; 1303 | } 1304 | .fa-renren:before { 1305 | content: "\f18b"; 1306 | } 1307 | .fa-pagelines:before { 1308 | content: "\f18c"; 1309 | } 1310 | .fa-stack-exchange:before { 1311 | content: "\f18d"; 1312 | } 1313 | .fa-arrow-circle-o-right:before { 1314 | content: "\f18e"; 1315 | } 1316 | .fa-arrow-circle-o-left:before { 1317 | content: "\f190"; 1318 | } 1319 | .fa-toggle-left:before, 1320 | .fa-caret-square-o-left:before { 1321 | content: "\f191"; 1322 | } 1323 | .fa-dot-circle-o:before { 1324 | content: "\f192"; 1325 | } 1326 | .fa-wheelchair:before { 1327 | content: "\f193"; 1328 | } 1329 | .fa-vimeo-square:before { 1330 | content: "\f194"; 1331 | } 1332 | .fa-turkish-lira:before, 1333 | .fa-try:before { 1334 | content: "\f195"; 1335 | } 1336 | .fa-plus-square-o:before { 1337 | content: "\f196"; 1338 | } 1339 | -------------------------------------------------------------------------------- /css/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawksley/eleVR-Picture-Player/4aab7649f4c3c6bfba10be1b6b978cefaa23de03/css/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /css/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawksley/eleVR-Picture-Player/4aab7649f4c3c6bfba10be1b6b978cefaa23de03/css/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /css/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawksley/eleVR-Picture-Player/4aab7649f4c3c6bfba10be1b6b978cefaa23de03/css/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /css/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawksley/eleVR-Picture-Player/4aab7649f4c3c6bfba10be1b6b978cefaa23de03/css/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /elelogo-square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawksley/eleVR-Picture-Player/4aab7649f4c3c6bfba10be1b6b978cefaa23de03/elelogo-square.png -------------------------------------------------------------------------------- /elevr-player.appcache: -------------------------------------------------------------------------------- 1 | CACHE MANIFEST 2 | # Version 1 3 | 4 | CACHE: 5 | js/elevr-player.js 6 | lib/gl-matrix.js 7 | lib/util.js 8 | lib/vr.js 9 | css/elevr-player.css 10 | css/font-awesome.css 11 | css/fonts/fontawesome-webfont.woff 12 | css/fonts/fontawesome-webfont.eot 13 | css/fonts/fontawesome-webfont.svg 14 | css/fonts/fontawesome-webfont.ttf 15 | css/fonts/FontAwesome.otf 16 | 17 | 18 | FALLBACK: 19 | # This will enable imagename4.png to be as a replacement for 20 | # all resources under the images dir when there is no network connectivity. 21 | 22 | NETWORK: 23 | # This will prevent other network resources from being accessed. 24 | -------------------------------------------------------------------------------- /elevr-player.html: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | eleVR Picture Player 23 | 24 | 25 | 26 | 27 | 28 | 29 | 79 | 80 | 81 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 |
105 |
106 |
Loading Panorama...
107 |
Try WASD + Q/E
108 |
109 |
110 |
Loading Panorama...
111 |
Try WASD + Q/E
112 |
113 | 114 | 115 | Your browser doesn't appear to support the HTML5 <canvas> element. 116 | 117 | 118 | 119 | 120 | 121 |
122 | 123 | 124 | 128 | 129 | 137 | 138 | 139 |
140 | 141 | 142 |
143 | 144 | 145 | -------------------------------------------------------------------------------- /images/Greeley_pan_small_stars.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawksley/eleVR-Picture-Player/4aab7649f4c3c6bfba10be1b6b978cefaa23de03/images/Greeley_pan_small_stars.jpg -------------------------------------------------------------------------------- /images/denver-botanical-5-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawksley/eleVR-Picture-Player/4aab7649f4c3c6bfba10be1b6b978cefaa23de03/images/denver-botanical-5-small.jpg -------------------------------------------------------------------------------- /images/kirby-cove-1-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawksley/eleVR-Picture-Player/4aab7649f4c3c6bfba10be1b6b978cefaa23de03/images/kirby-cove-1-small.jpg -------------------------------------------------------------------------------- /images/mosaic-math-art.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawksley/eleVR-Picture-Player/4aab7649f4c3c6bfba10be1b6b978cefaa23de03/images/mosaic-math-art.JPG -------------------------------------------------------------------------------- /images/phone-stereo-test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawksley/eleVR-Picture-Player/4aab7649f4c3c6bfba10be1b6b978cefaa23de03/images/phone-stereo-test.jpg -------------------------------------------------------------------------------- /images/utrecht-canal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawksley/eleVR-Picture-Player/4aab7649f4c3c6bfba10be1b6b978cefaa23de03/images/utrecht-canal.jpg -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | eleVR Picture Player 23 | 24 | 25 | 26 | 27 | 28 | 29 | 79 | 80 | 81 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 |
105 |
106 |
Loading Panorama...
107 |
Try WASD + Q/E
108 |
109 |
110 |
Loading Panorama...
111 |
Try WASD + Q/E
112 |
113 | 114 | 115 | Your browser doesn't appear to support the HTML5 <canvas> element. 116 | 117 | 118 | 119 | 120 | 121 |
122 | 124 | eleVR Picture Player - Fork me on Github! 125 | 126 | 127 | 128 | 132 | 133 | 141 | 142 | 143 |
144 | 145 | 146 |
147 | 148 | 149 | -------------------------------------------------------------------------------- /js/elevr-player.js: -------------------------------------------------------------------------------- 1 | /** 2 | * eleVR Web Player: A web viewer for 360 images on the Oculus 3 | * Copyright (C) 2014 Andrea Hawksley and Andrew Lutomirski 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | "use strict"; 21 | 22 | var container, canvas, fullScreenButton, 23 | pictureSelect, projectionSelect, 24 | leftLoad, rightLoad, panoImage; 25 | 26 | var gl, reqAnimFrameID = 0; 27 | var currentScreenOrientation = window.orientation || 0; // active default 28 | 29 | var positionsBuffer, 30 | verticesIndexBuffer, 31 | lastUpdateTime = 0; 32 | 33 | var texture; 34 | 35 | var mvMatrix, shader; 36 | 37 | var vrHMD, vrSensor; 38 | 39 | var manualRotateRate = new Float32Array([0, 0, 0]), // Vector, camera-relative 40 | manualRotation = quat.create(), 41 | manualControls = { 42 | 'a' : {index: 1, sign: 1, active: 0}, 43 | 'd' : {index: 1, sign: -1, active: 0}, 44 | 'w' : {index: 0, sign: 1, active: 0}, 45 | 's' : {index: 0, sign: -1, active: 0}, 46 | 'q' : {index: 2, sign: -1, active: 0}, 47 | 'e' : {index: 2, sign: 1, active: 0}, 48 | }, 49 | degtorad = Math.PI / 180, // Degree-to-Radian conversion 50 | prevFrameTime = null, 51 | showTiming = false, // Switch to true to show frame times in the console 52 | framesSinceIssue = 0; 53 | 54 | var phoneVR = null; 55 | 56 | var ProjectionEnum = Object.freeze({ 57 | EQUIRECT: 0, 58 | EQUIRECT_3D: 1}), 59 | projection = 0, 60 | 61 | pictureObjectURL = null; 62 | 63 | function runEleVRPlayer() { 64 | initWebVR(); 65 | 66 | initElements(); 67 | createControls(); 68 | 69 | initWebGL(); 70 | 71 | if (gl) { 72 | gl.clearColor(0.0, 0.0, 0.0, 0.0); 73 | gl.clearDepth(1.0); 74 | gl.disable(gl.DEPTH_TEST); 75 | 76 | setCanvasSize(); 77 | 78 | phoneVR = new PhoneVR(); 79 | 80 | // Keyboard Controls 81 | enableKeyControls(); 82 | 83 | shader = new ShaderProgram(gl, { 84 | fragmentShaderName: 'shader-fs', 85 | vertexShaderName: 'shader-vs', 86 | attributes: ['aVertexPosition'], 87 | uniforms: ['uSampler', 'eye', 'projection', 'proj_inv'], 88 | }); 89 | 90 | initBuffers(); 91 | initTextures(); 92 | 93 | panoImage.addEventListener("load", loaded); 94 | } 95 | } 96 | 97 | /** 98 | * Lots of Init Methods 99 | */ 100 | function initWebVR() { 101 | if (navigator.getVRDevices) { 102 | navigator.getVRDevices().then(vrDeviceCallback); 103 | } 104 | } 105 | 106 | function initElements() { 107 | container = document.getElementById("picture-container"); 108 | container.style.width = window.innerWidth + "px"; 109 | container.style.height = window.innerHeight + "px"; 110 | leftLoad = document.getElementById("left-load"); 111 | rightLoad = document.getElementById("right-load"); 112 | canvas = document.getElementById("glcanvas"); 113 | panoImage = document.getElementById("pano-image"); 114 | 115 | // Buttons 116 | fullScreenButton = document.getElementById("full-screen"); 117 | 118 | // Selectors 119 | pictureSelect = document.getElementById("picture-select"); 120 | projectionSelect = document.getElementById("projection-select"); 121 | 122 | document.getElementById('title-l').style.fontSize = window.outerHeight / 20 + 'px'; 123 | document.getElementById('title-r').style.fontSize = window.outerHeight / 20 + 'px'; 124 | document.getElementById('message-l').style.fontSize = window.outerHeight / 30 + 'px'; 125 | document.getElementById('message-r').style.fontSize = window.outerHeight / 30 + 'px'; 126 | } 127 | 128 | function initWebGL() { 129 | gl = null; 130 | 131 | try { 132 | gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl"); 133 | } catch(e) {} 134 | 135 | if (!gl) { 136 | alert("Unable to initialize WebGL. Your browser may not support it."); 137 | } 138 | } 139 | 140 | function initBuffers() { 141 | positionsBuffer = gl.createBuffer(); 142 | gl.bindBuffer(gl.ARRAY_BUFFER, positionsBuffer); 143 | var positions = [ 144 | -1.0, -1.0, 145 | 1.0, -1.0, 146 | 1.0, 1.0, 147 | -1.0, 1.0, 148 | ]; 149 | gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW); 150 | 151 | verticesIndexBuffer = gl.createBuffer(); 152 | gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, verticesIndexBuffer); 153 | var vertexIndices = [ 154 | 0, 1, 2, 0, 2, 3, 155 | ] 156 | gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, 157 | new Uint16Array(vertexIndices), gl.STATIC_DRAW); 158 | } 159 | 160 | function initTextures() { 161 | texture = gl.createTexture(); 162 | gl.bindTexture(gl.TEXTURE_2D, texture); 163 | gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); 164 | gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); 165 | gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); 166 | gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); 167 | gl.bindTexture(gl.TEXTURE_2D, null); 168 | } 169 | 170 | function setCanvasSize() { 171 | var screenWidth, screenHeight; 172 | screenWidth = window.innerWidth; 173 | screenHeight = window.innerHeight; 174 | 175 | if (typeof vrHMD !== 'undefined' && typeof util.isFullscreen() !== 'undefined' && util.isFullscreen()) { 176 | var rectHalf = vrHMD.getEyeParameters('right').renderRect; 177 | canvas.width = rectHalf.width * 2; 178 | canvas.height = rectHalf.height; 179 | 180 | canvas.style.width = screenWidth + 'px'; 181 | canvas.style.height = screenHeight + 'px'; 182 | } else { 183 | // query the various pixel ratios 184 | var devicePixelRatio = window.devicePixelRatio || 1; 185 | var backingStoreRatio = gl.webkitBackingStorePixelRatio || 186 | gl.mozBackingStorePixelRatio || 187 | gl.msBackingStorePixelRatio || 188 | gl.oBackingStorePixelRatio || 189 | gl.backingStorePixelRatio || 1; 190 | var ratio = devicePixelRatio / backingStoreRatio; 191 | 192 | if (canvas.width != screenWidth * ratio || canvas.height != screenHeight * ratio) { 193 | canvas.width = screenWidth * ratio; 194 | canvas.height = screenHeight * ratio; 195 | 196 | canvas.style.width = screenWidth + 'px'; 197 | canvas.style.height = screenHeight + 'px'; 198 | } 199 | } 200 | } 201 | 202 | function updateTexture() { 203 | gl.bindTexture(gl.TEXTURE_2D, texture); 204 | gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); 205 | gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, 206 | gl.UNSIGNED_BYTE, panoImage); 207 | gl.bindTexture(gl.TEXTURE_2D, null); 208 | } 209 | 210 | function vrDeviceCallback(vrdevs) { 211 | for (var i = 0; i < vrdevs.length; ++i) { 212 | if (vrdevs[i] instanceof HMDVRDevice) { 213 | vrHMD = vrdevs[i]; 214 | break; 215 | } 216 | } 217 | 218 | if (!vrHMD) 219 | return; 220 | 221 | // Then, find that HMD's position sensor 222 | for (var i = 0; i < vrdevs.length; ++i) { 223 | if (vrdevs[i] instanceof PositionSensorVRDevice && 224 | vrdevs[i].hardwareUnitId == vrHMD.hardwareUnitId) 225 | { 226 | vrSensor = vrdevs[i]; 227 | break; 228 | } 229 | } 230 | 231 | if (!vrSensor) { 232 | alert("Found a HMD, but didn't find its orientation sensor?"); 233 | } 234 | } 235 | 236 | /** 237 | * Drawing the scene 238 | */ 239 | function drawOneEye(eye, projectionMatrix) { 240 | gl.useProgram(shader.program); 241 | 242 | gl.bindBuffer(gl.ARRAY_BUFFER, positionsBuffer); 243 | gl.vertexAttribPointer(shader.attributes['aVertexPosition'], 2, gl.FLOAT, false, 0, 0); 244 | 245 | // Specify the texture to map onto the faces. 246 | gl.activeTexture(gl.TEXTURE0); 247 | gl.bindTexture(gl.TEXTURE_2D, texture); 248 | gl.uniform1i(shader.uniforms['uSampler'], 0); 249 | 250 | gl.uniform1f(shader.uniforms['eye'], eye); 251 | gl.uniform1f(shader.uniforms['projection'], projection); 252 | 253 | var rotation = mat4.create(); 254 | 255 | if(typeof vrSensor !== 'undefined') { 256 | var state = vrSensor.getState(); 257 | var totalRotation = quat.create(); 258 | if (state !== null && state.orientation !== null && typeof state.orientation !== 'undefined' 259 | && state.orientation.x != 0 260 | && state.orientation.y != 0 261 | && state.orientation.z != 0 262 | && state.orientation.w != 0) { 263 | var sensorOrientation = new Float32Array([state.orientation.x, state.orientation.y, state.orientation.z, state.orientation.w]); 264 | quat.multiply(totalRotation, manualRotation, sensorOrientation); 265 | } else { 266 | totalRotation = manualRotation; 267 | } 268 | mat4.fromQuat(rotation, totalRotation); 269 | } else { 270 | var totalRotation = quat.create(); 271 | quat.multiply(totalRotation, manualRotation, phoneVR.rotationQuat()); 272 | mat4.fromQuat(rotation, totalRotation); 273 | } 274 | 275 | var projectionInverse = mat4.create(); 276 | mat4.invert(projectionInverse, projectionMatrix) 277 | var inv = mat4.create(); 278 | mat4.multiply(inv, rotation, projectionInverse); 279 | 280 | gl.uniformMatrix4fv(shader.uniforms['proj_inv'], false, inv); 281 | 282 | if (eye == 0) { // left eye 283 | gl.viewport(0, 0, canvas.width/2, canvas.height); 284 | } else { // right eye 285 | gl.viewport(canvas.width/2, 0, canvas.width/2, canvas.height); 286 | } 287 | 288 | // Draw 289 | gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, verticesIndexBuffer); 290 | gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0); 291 | } 292 | 293 | function drawScene(frameTime) { 294 | if (showTiming) 295 | var start = performance.now(); 296 | 297 | setCanvasSize(); 298 | 299 | if (showTiming){ 300 | var canvasResized = performance.now(); 301 | } 302 | 303 | if (showTiming){ 304 | var textureLoaded = performance.now(); 305 | } 306 | 307 | if (prevFrameTime) { 308 | // Apply manual controls. 309 | var interval = (frameTime - prevFrameTime) * 0.001; 310 | 311 | var update = quat.fromValues(manualRotateRate[0] * interval, 312 | manualRotateRate[1] * interval, 313 | manualRotateRate[2] * interval, 1.0); 314 | quat.normalize(update, update); 315 | quat.multiply(manualRotation, manualRotation, update); 316 | } 317 | 318 | var perspectiveMatrix = mat4.create(); 319 | if (typeof vrHMD !== 'undefined') { 320 | var leftParams = vrHMD.getEyeParameters('left'); 321 | var rightParams = vrHMD.getEyeParameters('right'); 322 | perspectiveMatrix = util.mat4PerspectiveFromVRFieldOfView(leftParams.recommendedFieldOfView, 0.1, 10); 323 | drawOneEye(0, perspectiveMatrix); 324 | perspectiveMatrix = util.mat4PerspectiveFromVRFieldOfView(rightParams.recommendedFieldOfView, 0.1, 10); 325 | drawOneEye(1, perspectiveMatrix); 326 | } else { 327 | var ratio = (canvas.width/2)/canvas.height; 328 | mat4.perspective(perspectiveMatrix, Math.PI/2, ratio, .1, 10); 329 | drawOneEye(0, perspectiveMatrix); 330 | drawOneEye(1, perspectiveMatrix); 331 | } 332 | 333 | 334 | if (showTiming) { 335 | gl.finish(); 336 | var end = performance.now(); 337 | if (end - frameTime > 20) { 338 | console.log(framesSinceIssue + ' Frame time: ' + 339 | (start - frameTime) + 'ms animation frame lag + ' + 340 | (canvasResized - start) + 'ms canvas resized + ' + 341 | (textureLoaded - canvasResized) + 'ms to load texture + ' + 342 | (end - textureLoaded) + 'ms = ' + (end - frameTime) + 'ms'); 343 | framesSinceIssue = 0; 344 | } else { 345 | framesSinceIssue++; 346 | } 347 | } 348 | 349 | reqAnimFrameID = requestAnimationFrame(drawScene); 350 | prevFrameTime = frameTime; 351 | } 352 | 353 | /** 354 | * Shader Related Functions 355 | */ 356 | function ShaderProgram(gl, params) { 357 | this.params = params; 358 | this.fragmentShader = getShader(gl, this.params.fragmentShaderName); 359 | this.vertexShader = getShader(gl, this.params.vertexShaderName); 360 | 361 | this.program = gl.createProgram(); 362 | gl.attachShader(this.program, this.vertexShader); 363 | gl.attachShader(this.program, this.fragmentShader); 364 | gl.linkProgram(this.program); 365 | 366 | if (!gl.getProgramParameter(this.program, gl.LINK_STATUS)) { 367 | alert("Unable to initialize the shader program: " + gl.getProgramInfoLog(this.program)); 368 | } 369 | 370 | gl.useProgram(this.program); 371 | 372 | this.attributes = {} 373 | for (var i = 0; i < this.params.attributes.length; i++) { 374 | var name = this.params.attributes[i]; 375 | this.attributes[name] = gl.getAttribLocation(this.program, name); 376 | gl.enableVertexAttribArray(this.attributes[name]); 377 | } 378 | 379 | this.uniforms = {} 380 | for (var i = 0; i < this.params.uniforms.length; i++) { 381 | var name = this.params.uniforms[i]; 382 | this.uniforms[name] = gl.getUniformLocation(this.program, name); 383 | gl.enableVertexAttribArray(this.attributes[name]); 384 | } 385 | } 386 | 387 | function getShader(gl, id) { 388 | var shaderScript = document.getElementById(id); 389 | 390 | if (!shaderScript) { 391 | return null; 392 | } 393 | 394 | var theSource = ""; 395 | var currentChild = shaderScript.firstChild; 396 | 397 | while(currentChild) { 398 | if (currentChild.nodeType == 3) { 399 | theSource += currentChild.textContent; 400 | } 401 | 402 | currentChild = currentChild.nextSibling; 403 | } 404 | 405 | var shader; 406 | 407 | if (shaderScript.type == "x-shader/x-fragment") { 408 | shader = gl.createShader(gl.FRAGMENT_SHADER); 409 | } else if (shaderScript.type == "x-shader/x-vertex") { 410 | shader = gl.createShader(gl.VERTEX_SHADER); 411 | } else { 412 | return null; // Unknown shader type 413 | } 414 | 415 | gl.shaderSource(shader, theSource); 416 | gl.compileShader(shader); 417 | 418 | if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { 419 | alert("An error occurred compiling the shaders: " + gl.getShaderInfoLog(shader)); 420 | return null; 421 | } 422 | 423 | return shader; 424 | } 425 | 426 | /** 427 | * Commands 428 | */ 429 | function loaded() { 430 | leftLoad.style.display = "none"; 431 | rightLoad.style.display = "none"; 432 | 433 | updateTexture(); 434 | reqAnimFrameID = requestAnimationFrame(drawScene); 435 | } 436 | 437 | function selectLocalPicture() { 438 | var input = document.createElement("input"); 439 | input.type = "file"; 440 | input.accept = "image/*"; 441 | 442 | input.addEventListener("change", function (event) { 443 | var files = input.files; 444 | if (!files.length) { 445 | // The user didn't select anything. Sad. 446 | console.log('File selection canceled'); 447 | return; 448 | } 449 | 450 | pictureObjectURL = URL.createObjectURL(files[0]); 451 | console.log('Loading local file ', files[0].name, ' at URL ', pictureObjectURL); 452 | pictureSelect.value = ""; 453 | loadImage(pictureObjectURL); 454 | }); 455 | 456 | input.click(); 457 | } 458 | 459 | function loadImage(imageFile) { 460 | leftLoad.style.display = "block"; 461 | rightLoad.style.display = "block"; 462 | 463 | gl.clear(gl.COLOR_BUFFER_BIT); 464 | 465 | if (reqAnimFrameID) { 466 | cancelAnimationFrame(reqAnimFrameID); 467 | reqAnimFrameID = 0; 468 | } 469 | 470 | var oldObjURL = pictureObjectURL; 471 | pictureObjectURL = null; 472 | 473 | panoImage.src = imageFile; 474 | 475 | if (pictureObjectURL && pictureObjectURL != imageFile) { 476 | URL.removeObjectURL(oldObjURL); 477 | } 478 | } 479 | 480 | function fullscreen() { 481 | if (canvas.mozRequestFullScreen) { 482 | canvas.mozRequestFullScreen({ vrDisplay: vrHMD }); // Firefox 483 | } else if (canvas.webkitRequestFullscreen) { 484 | canvas.webkitRequestFullscreen({ vrDisplay: vrHMD }); // Chrome and Safari 485 | } else if (canvas.requestFullScreen){ 486 | canvas.requestFullscreen(); 487 | } 488 | } 489 | 490 | function fullscreenIgnoreHMD() { 491 | if (canvas.mozRequestFullScreen) { 492 | canvas.mozRequestFullScreen(); // Firefox 493 | } else if (canvas.webkitRequestFullscreen) { 494 | canvas.webkitRequestFullscreen(); // Chrome and Safari 495 | } else if (canvas.requestFullScreen){ 496 | canvas.requestFullscreen(); 497 | } 498 | } 499 | 500 | /** 501 | * Controls 502 | */ 503 | function createControls() { 504 | fullScreenButton.addEventListener("click", function() { 505 | fullscreen(); 506 | }); 507 | 508 | pictureSelect.addEventListener("change", function() { 509 | projection = pictureSelect.value[0]; 510 | projectionSelect.value = projection; 511 | loadImage(pictureSelect.value.substring(1)); 512 | }); 513 | 514 | 515 | projectionSelect.addEventListener("change", function() { 516 | projection = projectionSelect.value; 517 | }); 518 | 519 | document.getElementById("select-local-file").addEventListener("click", function(event) { 520 | event.preventDefault(); 521 | selectLocalPicture(); 522 | }); 523 | } 524 | 525 | /** 526 | * Keyboard Controls 527 | */ 528 | function enableKeyControls() { 529 | function key(event, sign) { 530 | var control = manualControls[String.fromCharCode(event.keyCode).toLowerCase()]; 531 | if (!control) 532 | return; 533 | if (sign == 1 && control.active || sign == -1 && !control.active) 534 | return; 535 | control.active = (sign == 1); 536 | manualRotateRate[control.index] += sign * control.sign; 537 | } 538 | 539 | function onkey(event) { 540 | switch (String.fromCharCode(event.charCode)) { 541 | case 'f': 542 | fullscreen(); 543 | break; 544 | case 'z': 545 | vrSensor.zeroSensor(); 546 | break; 547 | case 'g': 548 | fullscreenIgnoreHMD(); 549 | break; 550 | } 551 | } 552 | 553 | document.addEventListener('keydown', function(event) { key(event, 1); }, 554 | false); 555 | document.addEventListener('keyup', function(event) { key(event, -1); }, 556 | false); 557 | window.addEventListener("keypress", onkey, true); 558 | } 559 | -------------------------------------------------------------------------------- /js/elevr-player.js.orig: -------------------------------------------------------------------------------- 1 | /** 2 | * eleVR Web Player: A web player for 360 video on the Oculus 3 | * Copyright (C) 2014 Andrea Hawksley and Andrew Lutomirski 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | "use strict"; 21 | 22 | var container, canvas, video, playButton, muteButton, fullScreenButton, 23 | <<<<<<< HEAD 24 | seekBar, videoSelect, projectionSelect; 25 | // volumeBar; 26 | ======= 27 | seekBar, videoSelect, projectionSelect, left, right; 28 | >>>>>>> master 29 | 30 | var gl, reqAnimFrameID = 0; 31 | 32 | var positionsBuffer, 33 | verticesIndexBuffer, 34 | lastUpdateTime = 0; 35 | 36 | var texture, textureTime; 37 | 38 | var mvMatrix, shaderProgram, vertexPositionAttribute, directionAttribute; 39 | 40 | var stereoRenderer, vrstate, vrloaded = false; 41 | 42 | var manualRotateRate = new Float32Array([0, 0, 0]), // Vector, camera-relative 43 | manualRotation = quat.create(), 44 | manualControls = { 45 | 'a' : {index: 1, sign: 1, active: 0}, 46 | 'd' : {index: 1, sign: -1, active: 0}, 47 | 'w' : {index: 0, sign: 1, active: 0}, 48 | 's' : {index: 0, sign: -1, active: 0}, 49 | 'q' : {index: 2, sign: -1, active: 0}, 50 | 'e' : {index: 2, sign: 1, active: 0}, 51 | }, 52 | 53 | prevFrameTime = null, 54 | showTiming = false; // Switch to true to show frame times in the console 55 | 56 | var ProjectionEnum = Object.freeze({ 57 | EQUIRECT: 0, 58 | <<<<<<< HEAD 59 | EQUIRECT_3D: 1}), 60 | projection = 0; 61 | ======= 62 | EQUIRECT_3D: 1}); 63 | var projection = 0; 64 | >>>>>>> master 65 | 66 | var videoObjectURL = null; 67 | 68 | function runEleVRPlayer() { 69 | 70 | initElements(); 71 | createControls(); 72 | 73 | <<<<<<< HEAD 74 | initWebGL(); 75 | 76 | if (gl) { 77 | initCanvas(); 78 | gl.clearColor(0.0, 0.0, 0.0, 1.0); 79 | ======= 80 | initWebGL(canvas); 81 | if (gl) { 82 | gl.clearColor(0.0, 0.0, 0.0, 0.0); 83 | >>>>>>> master 84 | gl.clearDepth(1.0); 85 | gl.disable(gl.DEPTH_TEST); 86 | 87 | stereoRenderer = new vr.StereoRenderer(gl, { 88 | alpha: false, 89 | depth: false, 90 | stencil: false 91 | }); 92 | vrstate = new vr.State(); 93 | 94 | vr.load(function(error) { 95 | if (error) 96 | console.log('vr.js failed to initialize: ', error); 97 | vrloaded = true; 98 | }); 99 | 100 | enableKeyControls(); 101 | 102 | initShaders(); 103 | initBuffers(); 104 | initTextures(); 105 | 106 | video.addEventListener("canplaythrough", play, true); 107 | video.addEventListener("ended", ended, true); 108 | video.preload = "auto"; 109 | } 110 | } 111 | 112 | /** 113 | * Lots of Init Methods 114 | */ 115 | function initElements() { 116 | container = document.getElementById("video-container"); 117 | <<<<<<< HEAD 118 | ======= 119 | left = document.getElementById("left"); 120 | right = document.getElementById("right"); 121 | >>>>>>> master 122 | canvas = document.getElementById("glcanvas"); 123 | video = document.getElementById("video"); 124 | 125 | // Buttons 126 | playButton = document.getElementById("play-pause"); 127 | muteButton = document.getElementById("mute"); 128 | fullScreenButton = document.getElementById("full-screen"); 129 | 130 | // Sliders 131 | seekBar = document.getElementById("seek-bar"); 132 | <<<<<<< HEAD 133 | // volumeBar = document.getElementById("volume-bar"); 134 | ======= 135 | >>>>>>> master 136 | 137 | // Selectors 138 | videoSelect = document.getElementById("video-select"); 139 | projectionSelect = document.getElementById("projection-select"); 140 | } 141 | 142 | <<<<<<< HEAD 143 | function initWebGL() { 144 | ======= 145 | function initWebGL(canvas) { 146 | >>>>>>> master 147 | gl = null; 148 | 149 | try { 150 | gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl"); 151 | } catch(e) {} 152 | 153 | if (!gl) { 154 | alert("Unable to initialize WebGL. Your browser may not support it."); 155 | } 156 | } 157 | 158 | <<<<<<< HEAD 159 | function initCanvas() { 160 | // // query the various pixel ratios 161 | // var devicePixelRatio = window.devicePixelRatio || 1; 162 | // var backingStoreRatio = gl.webkitBackingStorePixelRatio || 163 | // gl.mozBackingStorePixelRatio || 164 | // gl.msBackingStorePixelRatio || 165 | // gl.oBackingStorePixelRatio || 166 | // gl.backingStorePixelRatio || 1; 167 | // var ratio = devicePixelRatio / backingStoreRatio; 168 | // 169 | // // upscale the canvas if the two ratios don't match 170 | // if (devicePixelRatio !== backingStoreRatio) { 171 | // 172 | // var oldWidth = canvas.width; 173 | // var oldHeight = canvas.height; 174 | // 175 | // canvas.width = oldWidth * ratio; 176 | // canvas.height = oldHeight * ratio; 177 | // 178 | // canvas.style.width = oldWidth + 'px'; 179 | // canvas.style.height = oldHeight + 'px'; 180 | // } 181 | } 182 | 183 | ======= 184 | >>>>>>> master 185 | function initBuffers() { 186 | positionsBuffer = gl.createBuffer(); 187 | gl.bindBuffer(gl.ARRAY_BUFFER, positionsBuffer); 188 | var positions = [ 189 | -1.0, -1.0, 190 | 1.0, -1.0, 191 | 1.0, 1.0, 192 | -1.0, 1.0, 193 | ]; 194 | gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW); 195 | 196 | verticesIndexBuffer = gl.createBuffer(); 197 | gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, verticesIndexBuffer); 198 | var vertexIndices = [ 199 | 0, 1, 2, 0, 2, 3, 200 | ] 201 | gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, 202 | new Uint16Array(vertexIndices), gl.STATIC_DRAW); 203 | } 204 | 205 | function initTextures() { 206 | texture = gl.createTexture(); 207 | gl.bindTexture(gl.TEXTURE_2D, texture); 208 | gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); 209 | gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); 210 | gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); 211 | gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); 212 | gl.bindTexture(gl.TEXTURE_2D, null); 213 | textureTime = undefined; 214 | } 215 | 216 | function updateTexture() { 217 | if (textureTime !== video.currentTime) { 218 | gl.bindTexture(gl.TEXTURE_2D, texture); 219 | gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); 220 | <<<<<<< HEAD 221 | gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, 222 | ======= 223 | gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, 224 | >>>>>>> master 225 | gl.UNSIGNED_BYTE, video); 226 | gl.bindTexture(gl.TEXTURE_2D, null); 227 | textureTime = video.currentTime; 228 | } 229 | } 230 | 231 | /** 232 | * Drawing the scene 233 | */ 234 | function drawOneEye(eye) { 235 | gl.useProgram(shaderProgram); 236 | 237 | gl.bindBuffer(gl.ARRAY_BUFFER, positionsBuffer); 238 | gl.vertexAttribPointer(vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0); 239 | 240 | // Specify the texture to map onto the faces. 241 | gl.activeTexture(gl.TEXTURE0); 242 | gl.bindTexture(gl.TEXTURE_2D, texture); 243 | gl.uniform1i(gl.getUniformLocation(shaderProgram, "uSampler"), 0); 244 | 245 | gl.uniform1f(gl.getUniformLocation(shaderProgram, "eye"), eye.viewport[0]*2); 246 | gl.uniform1f(gl.getUniformLocation(shaderProgram, "projection"), projection); 247 | 248 | var rotation = mat4.create(); 249 | <<<<<<< HEAD 250 | 251 | var totalRotation = quat.create(); 252 | quat.multiply(totalRotation, manualRotation, vrstate.hmd.rotation); 253 | mat4.fromQuat(rotation, totalRotation); 254 | ======= 255 | if (vrstate.hmd.present) { 256 | var totalRotation = quat.create(); 257 | quat.multiply(totalRotation, manualRotation, vrstate.hmd.rotation); 258 | mat4.fromQuat(rotation, totalRotation); 259 | } else { 260 | mat4.fromQuat(rotation, manualRotation); 261 | } 262 | >>>>>>> master 263 | 264 | var projectionInvLocation = gl.getUniformLocation(shaderProgram, "proj_inv"); 265 | 266 | var projectionInverse = mat4.create(); 267 | mat4.invert(projectionInverse, eye.projectionMatrix) 268 | var inv = mat4.create(); 269 | mat4.multiply(inv, rotation, projectionInverse); 270 | 271 | gl.uniformMatrix4fv(projectionInvLocation, false, inv); 272 | 273 | // Draw 274 | gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, verticesIndexBuffer); 275 | gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0); 276 | } 277 | 278 | <<<<<<< HEAD 279 | function drawRect(side) { 280 | gl.useProgram(shaderProgram); 281 | 282 | gl.bindBuffer(gl.ARRAY_BUFFER, positionsBuffer); 283 | gl.vertexAttribPointer(vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0); 284 | 285 | // Specify the texture to map onto the faces. 286 | gl.activeTexture(gl.TEXTURE0); 287 | gl.bindTexture(gl.TEXTURE_2D, texture); 288 | gl.uniform1i(gl.getUniformLocation(shaderProgram, "uSampler"), 0); 289 | 290 | gl.uniform1f(gl.getUniformLocation(shaderProgram, "eye"), side); 291 | gl.uniform1f(gl.getUniformLocation(shaderProgram, "projection"), projection); 292 | 293 | var rotation = mat4.create(); 294 | mat4.fromQuat(rotation, manualRotation); 295 | 296 | var projectionInvLocation = gl.getUniformLocation(shaderProgram, "proj_inv"); 297 | 298 | gl.uniformMatrix4fv(projectionInvLocation, false, rotation); 299 | 300 | if (projection == ProjectionEnum.EQUIRECT) { 301 | gl.viewport(100, 100, 860, 600); 302 | } else if (projection == ProjectionEnum.EQUIRECT_3D) { 303 | if (side == 1) { 304 | gl.viewport(100, 100, 430, 600); 305 | } else if (side == 0) { 306 | gl.viewport(530, 100, 430, 600); 307 | } 308 | } 309 | 310 | // Draw 311 | gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, verticesIndexBuffer); 312 | gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0); 313 | 314 | if (side == 0 && projection == ProjectionEnum.EQUIRECT_3D) { 315 | drawRect(1); 316 | } 317 | } 318 | 319 | function drawScene(frameTime) { 320 | if (showTiming) 321 | start = performance.now(); 322 | ======= 323 | function drawScene(frameTime) { 324 | if (showTiming) 325 | var start = performance.now(); 326 | >>>>>>> master 327 | 328 | updateTexture(); 329 | if (!vrloaded) 330 | return; 331 | 332 | if (showTiming) 333 | var textureLoaded = performance.now(); 334 | 335 | vr.pollState(vrstate); 336 | if (prevFrameTime) { 337 | // Apply manual controls. 338 | var interval = (frameTime - prevFrameTime) * 0.001; 339 | 340 | var update = quat.fromValues(manualRotateRate[0] * interval, 341 | manualRotateRate[1] * interval, 342 | manualRotateRate[2] * interval, 1.0); 343 | quat.normalize(update, update); 344 | quat.multiply(manualRotation, manualRotation, update); 345 | } 346 | 347 | <<<<<<< HEAD 348 | if (vrstate.hmd.present) { 349 | stereoRenderer.render(vrstate, drawOneEye, this); 350 | } else { 351 | drawRect(0); 352 | } 353 | ======= 354 | stereoRenderer.render(vrstate, drawOneEye, this); 355 | >>>>>>> master 356 | 357 | if (showTiming) { 358 | gl.finish(); 359 | var end = performance.now(); 360 | <<<<<<< HEAD 361 | console.log('Frame time: ' + (start - frameTime) + 'ms to drawScene + ' + 362 | ======= 363 | console.log('Frame time: ' + 364 | (start - frameTime) + 'ms animation frame lag + ' + 365 | >>>>>>> master 366 | (textureLoaded - start) + 'ms to load texture + ' + 367 | (end - textureLoaded) + 'ms = ' + (end - frameTime) + 'ms'); 368 | } 369 | 370 | reqAnimFrameID = requestAnimationFrame(drawScene); 371 | prevFrameTime = frameTime; 372 | } 373 | 374 | /** 375 | * Shader Related Functions 376 | */ 377 | function initShaders() { 378 | var fragmentShader = getShader(gl, "shader-fs"); 379 | var vertexShader = getShader(gl, "shader-vs"); 380 | 381 | shaderProgram = gl.createProgram(); 382 | gl.attachShader(shaderProgram, vertexShader); 383 | gl.attachShader(shaderProgram, fragmentShader); 384 | gl.linkProgram(shaderProgram); 385 | 386 | if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { 387 | <<<<<<< HEAD 388 | alert("Unable to initialize the shader program."); 389 | ======= 390 | alert("Unable to initialize the shader program: " + gl.getProgramInfoLog(shaderProgram)); 391 | >>>>>>> master 392 | } 393 | 394 | gl.useProgram(shaderProgram); 395 | 396 | vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition"); 397 | gl.enableVertexAttribArray(vertexPositionAttribute); 398 | } 399 | 400 | function getShader(gl, id) { 401 | var shaderScript = document.getElementById(id); 402 | 403 | if (!shaderScript) { 404 | return null; 405 | } 406 | 407 | var theSource = ""; 408 | var currentChild = shaderScript.firstChild; 409 | 410 | while(currentChild) { 411 | if (currentChild.nodeType == 3) { 412 | theSource += currentChild.textContent; 413 | } 414 | 415 | currentChild = currentChild.nextSibling; 416 | } 417 | 418 | var shader; 419 | 420 | if (shaderScript.type == "x-shader/x-fragment") { 421 | shader = gl.createShader(gl.FRAGMENT_SHADER); 422 | } else if (shaderScript.type == "x-shader/x-vertex") { 423 | shader = gl.createShader(gl.VERTEX_SHADER); 424 | } else { 425 | return null; // Unknown shader type 426 | } 427 | 428 | gl.shaderSource(shader, theSource); 429 | gl.compileShader(shader); 430 | 431 | if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { 432 | alert("An error occurred compiling the shaders: " + gl.getShaderInfoLog(shader)); 433 | return null; 434 | } 435 | 436 | return shader; 437 | } 438 | 439 | /** 440 | * Video Commands 441 | */ 442 | function play() { 443 | if (video.ended) { 444 | video.currentTime = 0.1; 445 | } 446 | <<<<<<< HEAD 447 | ======= 448 | left.style.display = "none"; 449 | right.style.display = "none"; 450 | 451 | >>>>>>> master 452 | video.play(); 453 | playButton.className = "fa fa-pause icon" 454 | 455 | reqAnimFrameID = requestAnimationFrame(drawScene); 456 | } 457 | 458 | function pause() { 459 | video.pause(); 460 | playButton.className = "fa fa-play icon"; 461 | } 462 | 463 | function ended() { 464 | pause(); 465 | if (reqAnimFrameID) { 466 | cancelAnimationFrame(reqAnimFrameID); 467 | reqAnimFrameID = 0; 468 | } 469 | } 470 | 471 | function mute() { 472 | video.muted = true; 473 | muteButton.className = "fa fa-volume-off icon"; 474 | } 475 | 476 | function unmute() { 477 | video.muted = false; 478 | muteButton.className = "fa fa-volume-up icon"; 479 | } 480 | 481 | function selectLocalVideo() { 482 | var input = document.createElement("input"); 483 | input.type = "file"; 484 | input.accept = "video/*"; 485 | 486 | input.addEventListener("change", function (event) { 487 | var files = input.files; 488 | if (!files.length) { 489 | // The user didn't select anything. Sad. 490 | console.log('File selection canceled'); 491 | return; 492 | } 493 | 494 | videoObjectURL = URL.createObjectURL(files[0]); 495 | console.log('Loading local file ', files[0].name, 496 | ' at URL ', videoObjectURL); 497 | videoSelect.value = ""; 498 | loadVideo(videoObjectURL); 499 | }); 500 | 501 | input.click(); 502 | } 503 | 504 | function loadVideo(videoFile) { 505 | pause(); 506 | <<<<<<< HEAD 507 | ======= 508 | left.style.display = "block"; 509 | right.style.display = "block"; 510 | 511 | // gl.clearColor(0.0, 0.0, 0.0, 1.0); 512 | gl.clear(gl.COLOR_BUFFER_BIT); 513 | 514 | >>>>>>> master 515 | if (reqAnimFrameID) { 516 | cancelAnimationFrame(reqAnimFrameID); 517 | reqAnimFrameID = 0; 518 | } 519 | 520 | // Hack to fix rotation for vidcon video for vidcon 521 | if (videoFile == "Vidcon.webm") { 522 | manualRotation = [0.38175851106643677, -0.7102527618408203, -0.2401944249868393, 0.5404701232910156]; 523 | } else { 524 | manualRotation = quat.create(); 525 | } 526 | 527 | var oldObjURL = videoObjectURL; 528 | videoObjectURL = null; 529 | 530 | video.src = videoFile; 531 | 532 | if (videoObjectURL && videoObjectURL != videoFile) 533 | URL.removeObjectURL(oldObjURL); 534 | } 535 | 536 | function fullscreen() { 537 | if (video.requestFullscreen) { 538 | container.requestFullscreen(); 539 | } else if (video.mozRequestFullScreen) { 540 | container.mozRequestFullScreen(); // Firefox 541 | } else if (video.webkitRequestFullscreen) { 542 | container.webkitRequestFullscreen(); // Chrome and Safari 543 | } 544 | } 545 | 546 | /** 547 | * Video Controls 548 | */ 549 | function createControls() { 550 | playButton.addEventListener("click", function() { 551 | if (video.paused == true) { 552 | play(); 553 | } else { 554 | pause(); 555 | } 556 | }); 557 | 558 | muteButton.addEventListener("click", function() { 559 | if (video.muted == false) { 560 | mute(); 561 | } else { 562 | unmute(); 563 | } 564 | }); 565 | 566 | fullScreenButton.addEventListener("click", function() { 567 | fullscreen(); 568 | }); 569 | 570 | seekBar.addEventListener("change", function() { 571 | // Calculate the new time 572 | var time = video.duration * (seekBar.value / 100); 573 | video.currentTime = time; 574 | }); 575 | 576 | video.addEventListener("timeupdate", function() { 577 | // don't update if paused, 578 | // we get last time update after seekBar mousedown pauses 579 | if (!video.paused) { 580 | // Calculate the slider value 581 | var value = (100 / video.duration) * video.currentTime; 582 | seekBar.value = value; 583 | } 584 | }); 585 | 586 | // Pause the video when the slider handle is being dragged 587 | var tempPause = false; 588 | seekBar.addEventListener("mousedown", function() { 589 | if (!video.paused) { 590 | video.pause(); 591 | tempPause = true; 592 | } 593 | }); 594 | 595 | seekBar.addEventListener("mouseup", function() { 596 | if (tempPause) { 597 | video.play(); 598 | } 599 | }); 600 | 601 | videoSelect.addEventListener("change", function() { 602 | projection = videoSelect.value[0]; 603 | projectionSelect.value = projection; 604 | loadVideo(videoSelect.value.substring(1)); 605 | }); 606 | 607 | 608 | projectionSelect.addEventListener("change", function() { 609 | projection = projectionSelect.value; 610 | }); 611 | 612 | document.getElementById("select-local-file").addEventListener("click", function(event) { 613 | event.preventDefault(); 614 | selectLocalVideo(); 615 | }); 616 | } 617 | 618 | /** 619 | * Keyboard Controls 620 | */ 621 | function enableKeyControls() { 622 | function key(event, sign) { 623 | var control = manualControls[String.fromCharCode(event.keyCode).toLowerCase()]; 624 | if (!control) 625 | return; 626 | if (sign == 1 && control.active || sign == -1 && !control.active) 627 | return; 628 | control.active = (sign == 1); 629 | manualRotateRate[control.index] += sign * control.sign; 630 | } 631 | 632 | document.addEventListener('keydown', function(event) { key(event, 1); }, 633 | false); 634 | document.addEventListener('keyup', function(event) { key(event, -1); }, 635 | false); 636 | } 637 | -------------------------------------------------------------------------------- /js/phonevr.js: -------------------------------------------------------------------------------- 1 | "use strict;" 2 | 3 | // It seems to be impossible to synchronously detect whether we have an orientation sensor. 4 | // Even Chromium on the desktop has a 'deviceorientation' event, and it will fire once with 5 | // all nulls. 6 | 7 | function PhoneVR() { 8 | this.deviceAlpha = null; 9 | this.deviceGamma = null; 10 | this.deviceBeta = null; 11 | 12 | window.addEventListener('deviceorientation', function(orientation) { 13 | this.deviceAlpha = orientation.alpha; 14 | this.deviceGamma = orientation.gamma; 15 | this.deviceBeta = orientation.beta; 16 | }.bind(this)); 17 | } 18 | 19 | PhoneVR.prototype.orientationIsAvailable = function() { 20 | return this.deviceAlpha !== null; 21 | } 22 | 23 | PhoneVR.prototype.rotationQuat = function() { 24 | if (!this.orientationIsAvailable()) 25 | return quat.create(1, 0, 0, 0); 26 | 27 | var degtorad = Math.PI / 180; // Degree-to-Radian conversion 28 | var z = this.deviceAlpha * degtorad / 2; 29 | var x = this.deviceBeta * degtorad / 2; 30 | var y = this.deviceGamma * degtorad / 2; 31 | var cX = Math.cos(x); 32 | var cY = Math.cos(y); 33 | var cZ = Math.cos(z); 34 | var sX = Math.sin(x); 35 | var sY = Math.sin(y); 36 | var sZ = Math.sin(z); 37 | 38 | // ZXY quaternion construction. 39 | var w = cX * cY * cZ - sX * sY * sZ; 40 | var x = sX * cY * cZ - cX * sY * sZ; 41 | var y = cX * sY * cZ + sX * cY * sZ; 42 | var z = cX * cY * sZ + sX * sY * cZ; 43 | 44 | var deviceQuaternion = quat.fromValues(x, y, z, w); 45 | 46 | // Correct for the screen orientation. 47 | var screenOrientation = (util.getScreenOrientation() * degtorad)/2; 48 | var screenTransform = [0, 0, -Math.sin(screenOrientation), Math.cos(screenOrientation)]; 49 | 50 | var deviceRotation = quat.create(); 51 | quat.multiply(deviceRotation, deviceQuaternion, screenTransform); 52 | 53 | // deviceRotation is the quaternion encoding of the transformation 54 | // from camera coordinates to world coordinates. The problem is that 55 | // our shader uses conventional OpenGL coordinates 56 | // (+x = right, +y = up, +z = backward), but the DeviceOrientation 57 | // spec uses different coordinates (+x = East, +y = North, +z = up). 58 | // To fix the mismatch, we need to fix this. We'll arbitrarily choose 59 | // North to correspond to -z (the default camera direction). 60 | var r22 = Math.sqrt(0.5); 61 | quat.multiply(deviceRotation, quat.fromValues(-r22, 0, 0, r22), deviceRotation); 62 | 63 | return deviceRotation; 64 | } 65 | -------------------------------------------------------------------------------- /lib/util.js: -------------------------------------------------------------------------------- 1 | (function(global) { 2 | var util = { 3 | getScreenOrientation: function() { 4 | switch (window.screen.orientation || window.screen.mozOrientation) { 5 | case 'landscape-primary': 6 | return 90; 7 | case 'landscape-secondary': 8 | return -90; 9 | case 'portrait-secondary': 10 | return 180; 11 | case 'portrait-primary': 12 | return 0; 13 | } 14 | if (window.orientation !== undefined) 15 | return window.orientation; 16 | }, 17 | 18 | mat4PerspectiveFromVRFieldOfView: function(fov, zNear, zFar) { 19 | var upTan = Math.tan(fov.upDegrees * Math.PI/180.0); 20 | var downTan = Math.tan(fov.downDegrees * Math.PI/180.0); 21 | var leftTan = Math.tan(fov.leftDegrees * Math.PI/180.0); 22 | var rightTan = Math.tan(fov.rightDegrees * Math.PI/180.0); 23 | 24 | var xScale = 2.0 / (leftTan + rightTan); 25 | var yScale = 2.0 / (upTan + downTan); 26 | 27 | var out = new Float32Array(16); // Appropriate format to pass to WebGL 28 | out[0] = xScale; 29 | out[4] = 0.0; 30 | out[8] = -((leftTan - rightTan) * xScale * 0.5); 31 | out[12] = 0.0; 32 | 33 | out[1] = 0.0; 34 | out[5] = yScale; 35 | out[9] = ((upTan - downTan) * yScale * 0.5); 36 | out[13] = 0.0; 37 | 38 | out[2] = 0.0; 39 | out[6] = 0.0; 40 | out[10] = zFar / (zNear - zFar); 41 | out[14] = (zFar * zNear) / (zNear - zFar); 42 | 43 | out[3] = 0.0; 44 | out[7] = 0.0; 45 | out[11] = -1.0; 46 | out[15] = 0.0; 47 | 48 | return out; 49 | }, 50 | 51 | isFullscreen: function() { 52 | return document.fullscreenElement 53 | || document.webkitFullscreenElement 54 | || document.mozFullScreenElement 55 | || document.webkitCurrentFullScreenElement; 56 | } 57 | }; 58 | 59 | global.util = util; 60 | 61 | })(window); 62 | --------------------------------------------------------------------------------