├── LICENSE.txt ├── Project.xcconfig ├── README.md ├── SimpleVR.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── neilvanvuuren.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── WorkspaceSettings.xcsettings └── xcuserdata │ └── neilvanvuuren.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── JustVideo.xcscheme │ └── xcschememanagement.plist ├── addons.make ├── bin └── data │ ├── Bridge_2k.mp4 │ ├── Default-568h@2x~iphone.png │ ├── Default.png │ ├── Default@2x.png │ ├── Default@2x~ipad.png │ ├── Default@2x~iphone.png │ ├── Default~ipad.png │ ├── Default~iphone.png │ ├── Icon-72.png │ ├── Icon-72@2x.png │ ├── Icon.png │ └── Icon@2x.png ├── ofxCoreMotion └── src │ ├── ofxCoreMotion.h │ └── ofxCoreMotion.mm ├── ofxiOS-Info.plist ├── ofxiOS_Prefix.pch └── src ├── VrVideo.h ├── VrVideo.mm ├── main.mm ├── ofApp.h └── ofApp.mm /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 NEIL VAN VUUREN 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/ios/CoreOF.xcconfig" 7 | 8 | OTHER_LDFLAGS = $(OF_CORE_LIBS) 9 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 10 | 11 | COMPRESS_PNG_FILES = NO 12 | GCC_THUMB_SUPPORT = NO 13 | IPHONEOS_DEPLOYMENT_TARGET = 3.1 14 | TARGETED_DEVICE_FAMILY = 1 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | An Openframeworks app to playback 360 / Panoramic / VR video for iOS 2 | ==================================================================== 3 | 4 | 5 | *Created as part of the website http://www.stateofvr.com* 6 | 7 | 8 | 9 | Has support for Mono, stereo Over Under and stereo Left right. 10 | 11 | 12 | 13 | Video resolution seems to be limited to ~3000x1500 on iPhone 6 and 14 | 2048x1024px on iPhone5 15 | 16 | 17 | Does not have vignette or barrel distortion for Cardboard…yet. 18 | 19 | 20 | 21 | Created with Openframeworks v0.8.4 22 | 23 | 24 | 25 | **Interaction:** 26 | 27 | 28 | Tap and drag to change camera view 29 | 30 | 31 | Double tap to swop to google cardboard mode 32 | 33 | **LICENSING** 34 | 35 | The MIT License (MIT) 36 | 37 | Copyright (c) 2016 NEIL VAN VUUREN 38 | 39 | Permission is hereby granted, free of charge, to any person obtaining a copy 40 | of this software and associated documentation files (the "Software"), to deal 41 | in the Software without restriction, including without limitation the rights 42 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 43 | copies of the Software, and to permit persons to whom the Software is 44 | furnished to do so, subject to the following conditions: 45 | 46 | The above copyright notice and this permission notice shall be included in all 47 | copies or substantial portions of the Software. 48 | 49 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 50 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 51 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 52 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 53 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 54 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 55 | SOFTWARE. 56 | -------------------------------------------------------------------------------- /SimpleVR.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 11 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 12 | 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; }; 13 | 5326AEA810A23A0500278DE6 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5326AEA710A23A0500278DE6 /* CoreLocation.framework */; }; 14 | 53F323EB10A20EDB00E0DAE4 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53F323EA10A20EDB00E0DAE4 /* OpenAL.framework */; }; 15 | 678E130817951530005B6D19 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 678E130717951530005B6D19 /* Icon@2x.png */; }; 16 | 678E130A17951536005B6D19 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 678E130917951536005B6D19 /* Icon.png */; }; 17 | 678E130C1795153C005B6D19 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 678E130B1795153C005B6D19 /* Default.png */; }; 18 | 678E130E17951540005B6D19 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 678E130D17951540005B6D19 /* Default@2x.png */; }; 19 | 678E131017951549005B6D19 /* Default-568h@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = 678E130F17951549005B6D19 /* Default-568h@2x~iphone.png */; }; 20 | 927001501B888D5B00571A0E /* VrVideo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9270014E1B888D5B00571A0E /* VrVideo.mm */; }; 21 | 927001591B896DAC00571A0E /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BBE5EAB70F49AD8400F28951 /* AudioToolbox.framework */; }; 22 | 92A184891B5FB7C300680F35 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 92A184881B5FB7C300680F35 /* CoreMotion.framework */; }; 23 | 92A1848C1B5FB84F00680F35 /* ofxCoreMotion.mm in Sources */ = {isa = PBXBuildFile; fileRef = 92A1848B1B5FB84F00680F35 /* ofxCoreMotion.mm */; }; 24 | BB16EBD20F2B2A9500518274 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BB16EBD10F2B2A9500518274 /* OpenGLES.framework */; }; 25 | BB16EBD90F2B2AB500518274 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BB16EBD80F2B2AB500518274 /* QuartzCore.framework */; }; 26 | E41D3ED713B38FB500A75A5D /* Project.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = E41D3ED613B38FB500A75A5D /* Project.xcconfig */; }; 27 | E41D3EE613B3906D00A75A5D /* CoreOF.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = E41D3EE513B3906D00A75A5D /* CoreOF.xcconfig */; }; 28 | E41D400B13B39D2100A75A5D /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E41D400613B39D2100A75A5D /* AVFoundation.framework */; }; 29 | E41D400C13B39D2100A75A5D /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E41D400713B39D2100A75A5D /* CoreMedia.framework */; }; 30 | E41D400D13B39D2100A75A5D /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E41D400813B39D2100A75A5D /* CoreVideo.framework */; }; 31 | E41D400E13B39D2100A75A5D /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E41D400913B39D2100A75A5D /* MapKit.framework */; }; 32 | E41D421413B3A95300A75A5D /* libofxiOS_iphoneos_Debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E41D410213B3A0D800A75A5D /* libofxiOS_iphoneos_Debug.a */; }; 33 | E4A823A412561BE3002F86A2 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4A823A312561BE3002F86A2 /* CoreGraphics.framework */; }; 34 | E4D8936E11527B74007E1F53 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = E4D8936B11527B74007E1F53 /* main.mm */; }; 35 | E4D8936F11527B74007E1F53 /* ofApp.mm in Sources */ = {isa = PBXBuildFile; fileRef = E4D8936D11527B74007E1F53 /* ofApp.mm */; }; 36 | /* End PBXBuildFile section */ 37 | 38 | /* Begin PBXContainerItemProxy section */ 39 | E41D410113B3A0D800A75A5D /* PBXContainerItemProxy */ = { 40 | isa = PBXContainerItemProxy; 41 | containerPortal = E41D40FD13B3A0D800A75A5D /* iOS+OFLib.xcodeproj */; 42 | proxyType = 2; 43 | remoteGlobalIDString = BB24DED610DA7A3F00E9C588; 44 | remoteInfo = "iPhone+OF Static Library"; 45 | }; 46 | E41D410313B3A11300A75A5D /* PBXContainerItemProxy */ = { 47 | isa = PBXContainerItemProxy; 48 | containerPortal = E41D40FD13B3A0D800A75A5D /* iOS+OFLib.xcodeproj */; 49 | proxyType = 1; 50 | remoteGlobalIDString = BB24DE5C10DA7A3F00E9C588; 51 | remoteInfo = "iPhone+OF Static Library"; 52 | }; 53 | /* End PBXContainerItemProxy section */ 54 | 55 | /* Begin PBXFileReference section */ 56 | 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 57 | 1D6058910D05DD3D006BFB54 /* SimpleVR.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleVR.app; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 59 | 288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 60 | 32CA4F630368D1EE00C91783 /* ofxiOS_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxiOS_Prefix.pch; sourceTree = ""; }; 61 | 5326AEA710A23A0500278DE6 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; 62 | 53F323EA10A20EDB00E0DAE4 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; 63 | 678E130717951530005B6D19 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "bin/data/Icon@2x.png"; sourceTree = ""; }; 64 | 678E130917951536005B6D19 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = bin/data/Icon.png; sourceTree = ""; }; 65 | 678E130B1795153C005B6D19 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = bin/data/Default.png; sourceTree = ""; }; 66 | 678E130D17951540005B6D19 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "bin/data/Default@2x.png"; sourceTree = ""; }; 67 | 678E130F17951549005B6D19 /* Default-568h@2x~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x~iphone.png"; path = "bin/data/Default-568h@2x~iphone.png"; sourceTree = ""; }; 68 | 9270014E1B888D5B00571A0E /* VrVideo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = VrVideo.mm; sourceTree = ""; }; 69 | 9270014F1B888D5B00571A0E /* VrVideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VrVideo.h; sourceTree = ""; }; 70 | 92A184881B5FB7C300680F35 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; 71 | 92A1848A1B5FB84F00680F35 /* ofxCoreMotion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ofxCoreMotion.h; path = ofxCoreMotion/src/ofxCoreMotion.h; sourceTree = ""; }; 72 | 92A1848B1B5FB84F00680F35 /* ofxCoreMotion.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ofxCoreMotion.mm; path = ofxCoreMotion/src/ofxCoreMotion.mm; sourceTree = ""; }; 73 | BB16EBD10F2B2A9500518274 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 74 | BB16EBD80F2B2AB500518274 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 75 | BB24DDC910DA781C00E9C588 /* ofxiOS-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ofxiOS-Info.plist"; sourceTree = ""; }; 76 | BBE5EAB70F49AD8400F28951 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 77 | E41D3ED613B38FB500A75A5D /* Project.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Project.xcconfig; sourceTree = ""; }; 78 | E41D3EE513B3906D00A75A5D /* CoreOF.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CoreOF.xcconfig; path = ../../../libs/openFrameworksCompiled/project/ios/CoreOF.xcconfig; sourceTree = SOURCE_ROOT; }; 79 | E41D400613B39D2100A75A5D /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 80 | E41D400713B39D2100A75A5D /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; 81 | E41D400813B39D2100A75A5D /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; 82 | E41D400913B39D2100A75A5D /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; 83 | E41D40FD13B3A0D800A75A5D /* iOS+OFLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "iOS+OFLib.xcodeproj"; path = "../../../libs/openFrameworksCompiled/project/ios/iOS+OFLib.xcodeproj"; sourceTree = SOURCE_ROOT; }; 84 | E4A823A312561BE3002F86A2 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 85 | E4D8936B11527B74007E1F53 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = main.mm; path = src/main.mm; sourceTree = SOURCE_ROOT; }; 86 | E4D8936C11527B74007E1F53 /* ofApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ofApp.h; path = src/ofApp.h; sourceTree = SOURCE_ROOT; }; 87 | E4D8936D11527B74007E1F53 /* ofApp.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ofApp.mm; path = src/ofApp.mm; sourceTree = SOURCE_ROOT; }; 88 | /* End PBXFileReference section */ 89 | 90 | /* Begin PBXFrameworksBuildPhase section */ 91 | 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { 92 | isa = PBXFrameworksBuildPhase; 93 | buildActionMask = 2147483647; 94 | files = ( 95 | 927001591B896DAC00571A0E /* AudioToolbox.framework in Frameworks */, 96 | 92A184891B5FB7C300680F35 /* CoreMotion.framework in Frameworks */, 97 | E41D421413B3A95300A75A5D /* libofxiOS_iphoneos_Debug.a in Frameworks */, 98 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 99 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 100 | 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */, 101 | BB16EBD20F2B2A9500518274 /* OpenGLES.framework in Frameworks */, 102 | BB16EBD90F2B2AB500518274 /* QuartzCore.framework in Frameworks */, 103 | 53F323EB10A20EDB00E0DAE4 /* OpenAL.framework in Frameworks */, 104 | 5326AEA810A23A0500278DE6 /* CoreLocation.framework in Frameworks */, 105 | E4A823A412561BE3002F86A2 /* CoreGraphics.framework in Frameworks */, 106 | E41D400B13B39D2100A75A5D /* AVFoundation.framework in Frameworks */, 107 | E41D400C13B39D2100A75A5D /* CoreMedia.framework in Frameworks */, 108 | E41D400D13B39D2100A75A5D /* CoreVideo.framework in Frameworks */, 109 | E41D400E13B39D2100A75A5D /* MapKit.framework in Frameworks */, 110 | ); 111 | runOnlyForDeploymentPostprocessing = 0; 112 | }; 113 | /* End PBXFrameworksBuildPhase section */ 114 | 115 | /* Begin PBXGroup section */ 116 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 1D6058910D05DD3D006BFB54 /* SimpleVR.app */, 120 | ); 121 | name = Products; 122 | sourceTree = ""; 123 | }; 124 | 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 92A184881B5FB7C300680F35 /* CoreMotion.framework */, 128 | 678E130917951536005B6D19 /* Icon.png */, 129 | 678E130717951530005B6D19 /* Icon@2x.png */, 130 | 678E130B1795153C005B6D19 /* Default.png */, 131 | 678E130D17951540005B6D19 /* Default@2x.png */, 132 | 678E130F17951549005B6D19 /* Default-568h@2x~iphone.png */, 133 | E4D8936A11527B74007E1F53 /* src */, 134 | BB24E1F710DAA51900E9C588 /* openFrameworks */, 135 | BB16F26B0F2B646B00518274 /* addons */, 136 | BB16E9930F2B1E5900518274 /* libs */, 137 | 19C28FACFE9D520D11CA2CBB /* Products */, 138 | ); 139 | name = CustomTemplate; 140 | sourceTree = ""; 141 | }; 142 | 29B97323FDCFA39411CA2CEA /* core frameworks */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | E41D400613B39D2100A75A5D /* AVFoundation.framework */, 146 | E41D400713B39D2100A75A5D /* CoreMedia.framework */, 147 | E41D400813B39D2100A75A5D /* CoreVideo.framework */, 148 | E41D400913B39D2100A75A5D /* MapKit.framework */, 149 | 53F323EA10A20EDB00E0DAE4 /* OpenAL.framework */, 150 | E4A823A312561BE3002F86A2 /* CoreGraphics.framework */, 151 | BBE5EAB70F49AD8400F28951 /* AudioToolbox.framework */, 152 | BB16EBD80F2B2AB500518274 /* QuartzCore.framework */, 153 | BB16EBD10F2B2A9500518274 /* OpenGLES.framework */, 154 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 155 | 1D30AB110D05D00D00671497 /* Foundation.framework */, 156 | 288765FC0DF74451002DB57D /* CoreGraphics.framework */, 157 | 5326AEA710A23A0500278DE6 /* CoreLocation.framework */, 158 | ); 159 | name = "core frameworks"; 160 | sourceTree = ""; 161 | }; 162 | BB16E9930F2B1E5900518274 /* libs */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | BBE5E94E0F497BD800F28951 /* core */, 166 | ); 167 | name = libs; 168 | sourceTree = ""; 169 | }; 170 | BB16F26B0F2B646B00518274 /* addons */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | 92A1848A1B5FB84F00680F35 /* ofxCoreMotion.h */, 174 | 92A1848B1B5FB84F00680F35 /* ofxCoreMotion.mm */, 175 | ); 176 | name = addons; 177 | sourceTree = ""; 178 | }; 179 | BB24E1F710DAA51900E9C588 /* openFrameworks */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | E41D40FD13B3A0D800A75A5D /* iOS+OFLib.xcodeproj */, 183 | 32CA4F630368D1EE00C91783 /* ofxiOS_Prefix.pch */, 184 | BB24DDC910DA781C00E9C588 /* ofxiOS-Info.plist */, 185 | E41D3EE513B3906D00A75A5D /* CoreOF.xcconfig */, 186 | E41D3ED613B38FB500A75A5D /* Project.xcconfig */, 187 | ); 188 | name = openFrameworks; 189 | sourceTree = ""; 190 | }; 191 | BBE5E94E0F497BD800F28951 /* core */ = { 192 | isa = PBXGroup; 193 | children = ( 194 | 29B97323FDCFA39411CA2CEA /* core frameworks */, 195 | ); 196 | name = core; 197 | sourceTree = ""; 198 | }; 199 | E41D40FE13B3A0D800A75A5D /* Products */ = { 200 | isa = PBXGroup; 201 | children = ( 202 | E41D410213B3A0D800A75A5D /* libofxiOS_iphoneos_Debug.a */, 203 | ); 204 | name = Products; 205 | sourceTree = ""; 206 | }; 207 | E4D8936A11527B74007E1F53 /* src */ = { 208 | isa = PBXGroup; 209 | children = ( 210 | E4D8936B11527B74007E1F53 /* main.mm */, 211 | E4D8936D11527B74007E1F53 /* ofApp.mm */, 212 | E4D8936C11527B74007E1F53 /* ofApp.h */, 213 | 9270014E1B888D5B00571A0E /* VrVideo.mm */, 214 | 9270014F1B888D5B00571A0E /* VrVideo.h */, 215 | ); 216 | path = src; 217 | sourceTree = SOURCE_ROOT; 218 | }; 219 | /* End PBXGroup section */ 220 | 221 | /* Begin PBXNativeTarget section */ 222 | 1D6058900D05DD3D006BFB54 /* SimpleVR */ = { 223 | isa = PBXNativeTarget; 224 | buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "SimpleVR" */; 225 | buildPhases = ( 226 | 1D60588D0D05DD3D006BFB54 /* Resources */, 227 | 1D60588E0D05DD3D006BFB54 /* Sources */, 228 | 1D60588F0D05DD3D006BFB54 /* Frameworks */, 229 | 9255DD331112741900D6945E /* ShellScript */, 230 | ); 231 | buildRules = ( 232 | ); 233 | dependencies = ( 234 | E41D410413B3A11300A75A5D /* PBXTargetDependency */, 235 | ); 236 | name = SimpleVR; 237 | productName = iPhone; 238 | productReference = 1D6058910D05DD3D006BFB54 /* SimpleVR.app */; 239 | productType = "com.apple.product-type.application"; 240 | }; 241 | /* End PBXNativeTarget section */ 242 | 243 | /* Begin PBXProject section */ 244 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 245 | isa = PBXProject; 246 | attributes = { 247 | LastUpgradeCheck = 0460; 248 | TargetAttributes = { 249 | 1D6058900D05DD3D006BFB54 = { 250 | DevelopmentTeam = AC9NEAU57Y; 251 | }; 252 | }; 253 | }; 254 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SimpleVR" */; 255 | compatibilityVersion = "Xcode 3.2"; 256 | developmentRegion = English; 257 | hasScannedForEncodings = 1; 258 | knownRegions = ( 259 | English, 260 | Japanese, 261 | French, 262 | German, 263 | ); 264 | mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; 265 | projectDirPath = ""; 266 | projectReferences = ( 267 | { 268 | ProductGroup = E41D40FE13B3A0D800A75A5D /* Products */; 269 | ProjectRef = E41D40FD13B3A0D800A75A5D /* iOS+OFLib.xcodeproj */; 270 | }, 271 | ); 272 | projectRoot = ""; 273 | targets = ( 274 | 1D6058900D05DD3D006BFB54 /* SimpleVR */, 275 | ); 276 | }; 277 | /* End PBXProject section */ 278 | 279 | /* Begin PBXReferenceProxy section */ 280 | E41D410213B3A0D800A75A5D /* libofxiOS_iphoneos_Debug.a */ = { 281 | isa = PBXReferenceProxy; 282 | fileType = archive.ar; 283 | path = libofxiOS_iphoneos_Debug.a; 284 | remoteRef = E41D410113B3A0D800A75A5D /* PBXContainerItemProxy */; 285 | sourceTree = BUILT_PRODUCTS_DIR; 286 | }; 287 | /* End PBXReferenceProxy section */ 288 | 289 | /* Begin PBXResourcesBuildPhase section */ 290 | 1D60588D0D05DD3D006BFB54 /* Resources */ = { 291 | isa = PBXResourcesBuildPhase; 292 | buildActionMask = 2147483647; 293 | files = ( 294 | E41D3ED713B38FB500A75A5D /* Project.xcconfig in Resources */, 295 | E41D3EE613B3906D00A75A5D /* CoreOF.xcconfig in Resources */, 296 | 678E130817951530005B6D19 /* Icon@2x.png in Resources */, 297 | 678E130A17951536005B6D19 /* Icon.png in Resources */, 298 | 678E130C1795153C005B6D19 /* Default.png in Resources */, 299 | 678E130E17951540005B6D19 /* Default@2x.png in Resources */, 300 | 678E131017951549005B6D19 /* Default-568h@2x~iphone.png in Resources */, 301 | ); 302 | runOnlyForDeploymentPostprocessing = 0; 303 | }; 304 | /* End PBXResourcesBuildPhase section */ 305 | 306 | /* Begin PBXShellScriptBuildPhase section */ 307 | 9255DD331112741900D6945E /* ShellScript */ = { 308 | isa = PBXShellScriptBuildPhase; 309 | buildActionMask = 2147483647; 310 | files = ( 311 | ); 312 | inputPaths = ( 313 | ); 314 | outputPaths = ( 315 | ); 316 | runOnlyForDeploymentPostprocessing = 0; 317 | shellPath = /bin/sh; 318 | shellScript = "cp -rf bin/data/ \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app\"\n"; 319 | }; 320 | /* End PBXShellScriptBuildPhase section */ 321 | 322 | /* Begin PBXSourcesBuildPhase section */ 323 | 1D60588E0D05DD3D006BFB54 /* Sources */ = { 324 | isa = PBXSourcesBuildPhase; 325 | buildActionMask = 2147483647; 326 | files = ( 327 | E4D8936E11527B74007E1F53 /* main.mm in Sources */, 328 | 927001501B888D5B00571A0E /* VrVideo.mm in Sources */, 329 | E4D8936F11527B74007E1F53 /* ofApp.mm in Sources */, 330 | 92A1848C1B5FB84F00680F35 /* ofxCoreMotion.mm in Sources */, 331 | ); 332 | runOnlyForDeploymentPostprocessing = 0; 333 | }; 334 | /* End PBXSourcesBuildPhase section */ 335 | 336 | /* Begin PBXTargetDependency section */ 337 | E41D410413B3A11300A75A5D /* PBXTargetDependency */ = { 338 | isa = PBXTargetDependency; 339 | name = "iPhone+OF Static Library"; 340 | targetProxy = E41D410313B3A11300A75A5D /* PBXContainerItemProxy */; 341 | }; 342 | /* End PBXTargetDependency section */ 343 | 344 | /* Begin XCBuildConfiguration section */ 345 | 1D6058940D05DD3E006BFB54 /* Debug */ = { 346 | isa = XCBuildConfiguration; 347 | buildSettings = { 348 | ALWAYS_SEARCH_USER_PATHS = NO; 349 | CODE_SIGN_IDENTITY = "iPhone Developer"; 350 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 351 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 352 | GCC_PREFIX_HEADER = ofxiOS_Prefix.pch; 353 | INFOPLIST_FILE = "ofxiOS-Info.plist"; 354 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 355 | PRODUCT_NAME = SimpleVR; 356 | PROVISIONING_PROFILE = ""; 357 | TARGETED_DEVICE_FAMILY = 1; 358 | USER_HEADER_SEARCH_PATHS = ""; 359 | VALID_ARCHS = "armv6 armv7"; 360 | }; 361 | name = Debug; 362 | }; 363 | 1D6058950D05DD3E006BFB54 /* Release */ = { 364 | isa = XCBuildConfiguration; 365 | buildSettings = { 366 | CODE_SIGN_IDENTITY = "iPhone Developer"; 367 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 368 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 369 | GCC_PREFIX_HEADER = ofxiOS_Prefix.pch; 370 | INFOPLIST_FILE = "ofxiOS-Info.plist"; 371 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 372 | PRODUCT_NAME = SimpleVR; 373 | PROVISIONING_PROFILE = ""; 374 | TARGETED_DEVICE_FAMILY = 1; 375 | USER_HEADER_SEARCH_PATHS = ""; 376 | VALID_ARCHS = "armv6 armv7"; 377 | }; 378 | name = Release; 379 | }; 380 | C01FCF4F08A954540054247B /* Debug */ = { 381 | isa = XCBuildConfiguration; 382 | baseConfigurationReference = E41D3ED613B38FB500A75A5D /* Project.xcconfig */; 383 | buildSettings = { 384 | ALWAYS_SEARCH_USER_PATHS = YES; 385 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 386 | CLANG_CXX_LIBRARY = "libstdc++"; 387 | CODE_SIGN_IDENTITY = ""; 388 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 389 | COMPRESS_PNG_FILES = NO; 390 | GCC_C_LANGUAGE_STANDARD = c99; 391 | GCC_OPTIMIZATION_LEVEL = 0; 392 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 393 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; 394 | GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO; 395 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 396 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; 397 | GCC_WARN_PROTOTYPE_CONVERSION = NO; 398 | GCC_WARN_UNUSED_VARIABLE = YES; 399 | IPHONEOS_DEPLOYMENT_TARGET = 3.1; 400 | ONLY_ACTIVE_ARCH = NO; 401 | "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; 402 | SDKROOT = iphoneos; 403 | TARGETED_DEVICE_FAMILY = 1; 404 | WARNING_LDFLAGS = "-no_arch_warnings"; 405 | }; 406 | name = Debug; 407 | }; 408 | C01FCF5008A954540054247B /* Release */ = { 409 | isa = XCBuildConfiguration; 410 | baseConfigurationReference = E41D3ED613B38FB500A75A5D /* Project.xcconfig */; 411 | buildSettings = { 412 | ALWAYS_SEARCH_USER_PATHS = YES; 413 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 414 | CLANG_CXX_LIBRARY = "libstdc++"; 415 | CODE_SIGN_IDENTITY = ""; 416 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 417 | COMPRESS_PNG_FILES = NO; 418 | GCC_C_LANGUAGE_STANDARD = c99; 419 | GCC_DYNAMIC_NO_PIC = YES; 420 | GCC_GENERATE_DEBUGGING_SYMBOLS = NO; 421 | GCC_OPTIMIZATION_LEVEL = 3; 422 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 423 | GCC_THUMB_SUPPORT = NO; 424 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 425 | GCC_WARN_UNUSED_VARIABLE = YES; 426 | IPHONEOS_DEPLOYMENT_TARGET = 3.1; 427 | ONLY_ACTIVE_ARCH = NO; 428 | SDKROOT = iphoneos; 429 | TARGETED_DEVICE_FAMILY = 1; 430 | WARNING_LDFLAGS = "-no_arch_warnings"; 431 | }; 432 | name = Release; 433 | }; 434 | /* End XCBuildConfiguration section */ 435 | 436 | /* Begin XCConfigurationList section */ 437 | 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "SimpleVR" */ = { 438 | isa = XCConfigurationList; 439 | buildConfigurations = ( 440 | 1D6058940D05DD3E006BFB54 /* Debug */, 441 | 1D6058950D05DD3E006BFB54 /* Release */, 442 | ); 443 | defaultConfigurationIsVisible = 0; 444 | defaultConfigurationName = Release; 445 | }; 446 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SimpleVR" */ = { 447 | isa = XCConfigurationList; 448 | buildConfigurations = ( 449 | C01FCF4F08A954540054247B /* Debug */, 450 | C01FCF5008A954540054247B /* Release */, 451 | ); 452 | defaultConfigurationIsVisible = 0; 453 | defaultConfigurationName = Release; 454 | }; 455 | /* End XCConfigurationList section */ 456 | }; 457 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 458 | } 459 | -------------------------------------------------------------------------------- /SimpleVR.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SimpleVR.xcodeproj/project.xcworkspace/xcuserdata/neilvanvuuren.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anodeaday/Virtual-Reality-Video---iOS/4921b8979c27d205169704d4a17789b0a06d1fb8/SimpleVR.xcodeproj/project.xcworkspace/xcuserdata/neilvanvuuren.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SimpleVR.xcodeproj/project.xcworkspace/xcuserdata/neilvanvuuren.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildLocationStyle 6 | UseAppPreferences 7 | CustomBuildLocationType 8 | RelativeToDerivedData 9 | DerivedDataLocationStyle 10 | Default 11 | IssueFilterStyle 12 | ShowActiveSchemeOnly 13 | LiveSourceIssuesEnabled 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /SimpleVR.xcodeproj/xcuserdata/neilvanvuuren.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /SimpleVR.xcodeproj/xcuserdata/neilvanvuuren.xcuserdatad/xcschemes/JustVideo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /SimpleVR.xcodeproj/xcuserdata/neilvanvuuren.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | JustVideo.xcscheme 8 | 9 | orderHint 10 | 1 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 1D6058900D05DD3D006BFB54 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anodeaday/Virtual-Reality-Video---iOS/4921b8979c27d205169704d4a17789b0a06d1fb8/addons.make -------------------------------------------------------------------------------- /bin/data/Bridge_2k.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anodeaday/Virtual-Reality-Video---iOS/4921b8979c27d205169704d4a17789b0a06d1fb8/bin/data/Bridge_2k.mp4 -------------------------------------------------------------------------------- /bin/data/Default-568h@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anodeaday/Virtual-Reality-Video---iOS/4921b8979c27d205169704d4a17789b0a06d1fb8/bin/data/Default-568h@2x~iphone.png -------------------------------------------------------------------------------- /bin/data/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anodeaday/Virtual-Reality-Video---iOS/4921b8979c27d205169704d4a17789b0a06d1fb8/bin/data/Default.png -------------------------------------------------------------------------------- /bin/data/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anodeaday/Virtual-Reality-Video---iOS/4921b8979c27d205169704d4a17789b0a06d1fb8/bin/data/Default@2x.png -------------------------------------------------------------------------------- /bin/data/Default@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anodeaday/Virtual-Reality-Video---iOS/4921b8979c27d205169704d4a17789b0a06d1fb8/bin/data/Default@2x~ipad.png -------------------------------------------------------------------------------- /bin/data/Default@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anodeaday/Virtual-Reality-Video---iOS/4921b8979c27d205169704d4a17789b0a06d1fb8/bin/data/Default@2x~iphone.png -------------------------------------------------------------------------------- /bin/data/Default~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anodeaday/Virtual-Reality-Video---iOS/4921b8979c27d205169704d4a17789b0a06d1fb8/bin/data/Default~ipad.png -------------------------------------------------------------------------------- /bin/data/Default~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anodeaday/Virtual-Reality-Video---iOS/4921b8979c27d205169704d4a17789b0a06d1fb8/bin/data/Default~iphone.png -------------------------------------------------------------------------------- /bin/data/Icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anodeaday/Virtual-Reality-Video---iOS/4921b8979c27d205169704d4a17789b0a06d1fb8/bin/data/Icon-72.png -------------------------------------------------------------------------------- /bin/data/Icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anodeaday/Virtual-Reality-Video---iOS/4921b8979c27d205169704d4a17789b0a06d1fb8/bin/data/Icon-72@2x.png -------------------------------------------------------------------------------- /bin/data/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anodeaday/Virtual-Reality-Video---iOS/4921b8979c27d205169704d4a17789b0a06d1fb8/bin/data/Icon.png -------------------------------------------------------------------------------- /bin/data/Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anodeaday/Virtual-Reality-Video---iOS/4921b8979c27d205169704d4a17789b0a06d1fb8/bin/data/Icon@2x.png -------------------------------------------------------------------------------- /ofxCoreMotion/src/ofxCoreMotion.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #import "ofMain.h" 4 | #include "ofxiPhone.h" 5 | #include "ofxiPhoneExtras.h" 6 | #import 7 | 8 | /* 9 | ofxCoreMotion created by Trent Brooks. 10 | - Original DeviceMotion/attitude example by Nardove: http://forum.openframeworks.cc/index.php/topic,11517.0.html - Thanks! 11 | - Added Gyroscope, accelerometer, & magnetometer. 12 | - Attitude also has quaternion (used to spin the box in the example) 13 | 14 | Dependencies: 15 | 1. add the 'CoreMotion.framework' to your OF xcode project 16 | - Under TARGETS > ofxCoreMotionExample, under the 'Build Phases' tab, where it says 'Link binary with libraries', click '+' and select the 'CoreMotion.framework'. 17 | */ 18 | 19 | 20 | #pragma once 21 | 22 | class ofxCoreMotion { 23 | 24 | public: 25 | 26 | ofxCoreMotion(); 27 | virtual ~ofxCoreMotion(); 28 | 29 | void setup(bool enableAttitude = true, bool enableAccelerometer = false, bool enableGyro = false, bool enableMagnetometer = false); 30 | 31 | void setupGyroscope(); 32 | void setupAccelerometer(); 33 | void setupMagnetometer(); 34 | void setupAttitude(CMAttitudeReferenceFrame type = CMAttitudeReferenceFrameXArbitraryZVertical); 35 | 36 | void disableGyroscope(); 37 | void disableAccelerometer(); 38 | void disableMagnetometer(); 39 | void disableAttitude(); 40 | 41 | void resetAttitude(bool toCurrentReferenceFrame = true); 42 | 43 | void setUpdateFrequency(float updateFrequency); 44 | void update(); 45 | 46 | ofVec3f getAccelerometerData(); 47 | ofVec3f getGyroscopeData(); 48 | ofVec3f getMagnetometerData(); 49 | float getRoll(); 50 | float getPitch(); 51 | float getYaw(); 52 | ofQuaternion getQuaternion(); 53 | ofMatrix4x4 getRotationMatrix(); 54 | //GLfloat* getRotationMatrix(); 55 | ofVec3f getGravity(); 56 | ofVec3f getUserAcceleration(); 57 | ofVec3f getMagneticField(); 58 | 59 | protected: 60 | 61 | // core motion 62 | CMMotionManager* motionManager; 63 | CMAttitude* referenceAttitude; 64 | CMAttitudeReferenceFrame referenceFrameType; // 1,2,4,8 65 | 66 | float updateFrequency; 67 | bool enableAttitude, enableGyro, enableAccelerometer, enableMagnetometer; 68 | 69 | ofVec3f accelerometerData; 70 | ofVec3f gyroscopeData; 71 | ofVec3f magnetometerData; 72 | float roll, pitch, yaw; 73 | ofQuaternion attitudeQuat; 74 | ofMatrix4x4 rotMatrix; 75 | //GLfloat rotMatrix[16]; 76 | ofVec3f gravity; 77 | ofVec3f userAcceleration; 78 | ofVec3f magneticField; 79 | 80 | }; 81 | 82 | -------------------------------------------------------------------------------- /ofxCoreMotion/src/ofxCoreMotion.mm: -------------------------------------------------------------------------------- 1 | 2 | #include "ofxCoreMotion.h" 3 | 4 | 5 | ofxCoreMotion::ofxCoreMotion() { 6 | 7 | motionManager = [[CMMotionManager alloc] init]; 8 | referenceAttitude = nil; 9 | referenceFrameType = [motionManager attitudeReferenceFrame]; // default = 1,CMAttitudeReferenceFrameXArbitraryZVertical 10 | updateFrequency = 1.0f/120.0f; //EDITED BY NEIL 11 | roll = pitch = yaw = 0; 12 | enableAttitude = false; 13 | enableGyro = false; 14 | enableAccelerometer = false; 15 | enableMagnetometer = false; 16 | } 17 | 18 | 19 | ofxCoreMotion::~ofxCoreMotion() { 20 | 21 | [referenceAttitude release]; 22 | referenceAttitude = nil; 23 | [motionManager stopAccelerometerUpdates]; 24 | [motionManager stopGyroUpdates]; 25 | [motionManager stopMagnetometerUpdates]; 26 | [motionManager stopDeviceMotionUpdates]; 27 | [motionManager release]; 28 | motionManager = nil; 29 | } 30 | 31 | void ofxCoreMotion::setup(bool enableAttitude, bool enableAccelerometer, bool enableGyro, bool enableMagnetometer) { 32 | 33 | if(enableAttitude) setupAttitude(); 34 | if(enableAccelerometer) setupAccelerometer(); 35 | if(enableGyro) setupGyroscope(); 36 | if(enableMagnetometer) setupMagnetometer(); 37 | } 38 | 39 | void ofxCoreMotion::setupAttitude(CMAttitudeReferenceFrame type) { 40 | 41 | enableAttitude = true; 42 | referenceFrameType = type; 43 | 44 | [motionManager setDeviceMotionUpdateInterval: updateFrequency]; 45 | 46 | // default is CMAttitudeReferenceFrameXArbitraryZVertical 47 | // [motionManager startDeviceMotionUpdates]; 48 | [motionManager startDeviceMotionUpdatesUsingReferenceFrame:referenceFrameType]; 49 | 50 | } 51 | 52 | void ofxCoreMotion::disableAttitude() { 53 | 54 | [motionManager stopDeviceMotionUpdates]; 55 | enableAttitude = false; 56 | roll = pitch = yaw = 0; 57 | attitudeQuat.set(0, 0, 0, 1); 58 | rotMatrix.makeIdentityMatrix(); 59 | gravity.set(0,0,0); 60 | userAcceleration.set(0, 0, 0); 61 | magneticField.set(0, 0, 0); 62 | 63 | } 64 | 65 | void ofxCoreMotion::setupAccelerometer() { 66 | 67 | enableAccelerometer = true; 68 | [motionManager setAccelerometerUpdateInterval:updateFrequency]; 69 | [motionManager startAccelerometerUpdates]; 70 | } 71 | 72 | void ofxCoreMotion::disableAccelerometer() { 73 | 74 | [motionManager stopAccelerometerUpdates]; 75 | enableAccelerometer = false; 76 | accelerometerData.set(0, 0, 0); 77 | } 78 | 79 | void ofxCoreMotion::setupGyroscope() { 80 | 81 | enableGyro = true; 82 | [motionManager setGyroUpdateInterval:updateFrequency]; 83 | [motionManager startGyroUpdates]; 84 | } 85 | 86 | void ofxCoreMotion::disableGyroscope() { 87 | 88 | [motionManager stopGyroUpdates]; 89 | enableGyro = false; 90 | gyroscopeData.set(0, 0, 0); 91 | } 92 | 93 | void ofxCoreMotion::setupMagnetometer() { 94 | 95 | enableMagnetometer = true; 96 | [motionManager setMagnetometerUpdateInterval:updateFrequency]; 97 | [motionManager startMagnetometerUpdates]; 98 | } 99 | 100 | void ofxCoreMotion::disableMagnetometer() { 101 | 102 | [motionManager stopMagnetometerUpdates]; 103 | enableMagnetometer = false; 104 | magnetometerData.set(0, 0, 0); 105 | } 106 | 107 | void ofxCoreMotion::setUpdateFrequency(float updateFrequency) { 108 | 109 | // default = 1.0f/ofGetFrameRate(); 110 | this->updateFrequency = updateFrequency; 111 | if(enableAttitude) [motionManager setDeviceMotionUpdateInterval: updateFrequency]; 112 | if(enableAccelerometer) [motionManager setAccelerometerUpdateInterval:updateFrequency]; 113 | if(enableGyro) [motionManager setGyroUpdateInterval:updateFrequency]; 114 | if(enableMagnetometer) [motionManager setMagnetometerUpdateInterval:updateFrequency]; 115 | } 116 | 117 | 118 | // resets reference attitude to current or null's the ref frame 119 | void ofxCoreMotion::resetAttitude(bool toCurrentReferenceFrame) { 120 | 121 | if(toCurrentReferenceFrame) { 122 | CMDeviceMotion *deviceMotion = motionManager.deviceMotion; 123 | CMAttitude *attitude = deviceMotion.attitude; 124 | referenceAttitude = [attitude retain]; 125 | } else { 126 | if(referenceAttitude != nil) { 127 | [referenceAttitude release]; 128 | referenceAttitude = nil; 129 | } 130 | } 131 | } 132 | 133 | 134 | // convenience method to update all objc properties to OF friendly at once 135 | void ofxCoreMotion::update() { 136 | 137 | CMDeviceMotion *deviceMotion = motionManager.deviceMotion; 138 | 139 | 140 | if(enableAttitude) { 141 | 142 | // gravity 143 | gravity.x = deviceMotion.gravity.x; 144 | gravity.y = deviceMotion.gravity.y; 145 | gravity.z = deviceMotion.gravity.z; 146 | 147 | // user acceleration 148 | userAcceleration.x = deviceMotion.userAcceleration.x; 149 | userAcceleration.y = deviceMotion.userAcceleration.y; 150 | userAcceleration.z = deviceMotion.userAcceleration.z; 151 | 152 | // magnetic field 153 | magneticField.x = deviceMotion.magneticField.field.x; 154 | magneticField.y = deviceMotion.magneticField.field.y; 155 | magneticField.z = deviceMotion.magneticField.field.z; 156 | 157 | CMAttitude *attitude = deviceMotion.attitude; 158 | if (referenceAttitude != nil ) { 159 | [attitude multiplyByInverseOfAttitude:referenceAttitude]; 160 | } 161 | 162 | 163 | // attitude euler angles 164 | roll = attitude.roll; 165 | pitch = attitude.pitch; 166 | yaw = attitude.yaw; 167 | 168 | 169 | // attitude quaternion 170 | CMQuaternion quat = attitude.quaternion; 171 | attitudeQuat.set(quat.x, quat.y, quat.z, quat.w); 172 | 173 | // attitude rotation matrix 174 | CMRotationMatrix rot = attitude.rotationMatrix; 175 | rotMatrix.set(rot.m11, rot.m21, rot.m31, 0, 176 | rot.m12, rot.m22, rot.m32, 0, 177 | rot.m13, rot.m23, rot.m33, 0, 178 | 0, 0, 0, 1); 179 | /*rotMatrix[0] = rot.m11; rotMatrix[1] = rot.m21; rotMatrix[2] = rot.m31; rotMatrix[3] = 0; 180 | rotMatrix[4] = rot.m12; rotMatrix[5] = rot.m22; rotMatrix[6] = rot.m32; rotMatrix[7] = 0; 181 | rotMatrix[8] = rot.m13; rotMatrix[9] = rot.m23; rotMatrix[10] = rot.m33; rotMatrix[11] = 0; 182 | rotMatrix[12] = 0; rotMatrix[13] = 0; rotMatrix[14] = 0; rotMatrix[15] = 1;*/ 183 | } 184 | 185 | if(enableAccelerometer) { 186 | CMAccelerometerData* acc = motionManager.accelerometerData; 187 | accelerometerData.x = acc.acceleration.x; 188 | accelerometerData.y = acc.acceleration.y; 189 | accelerometerData.z = acc.acceleration.z; 190 | } 191 | 192 | if(enableGyro) { 193 | CMGyroData* gyro = motionManager.gyroData; 194 | gyroscopeData.x = gyro.rotationRate.x; 195 | gyroscopeData.y = gyro.rotationRate.y; 196 | gyroscopeData.z = gyro.rotationRate.z; 197 | } 198 | 199 | if(enableMagnetometer) { 200 | CMMagnetometerData *mag = motionManager.magnetometerData; 201 | magnetometerData.x = mag.magneticField.x; 202 | magnetometerData.y = mag.magneticField.y; 203 | magnetometerData.z = mag.magneticField.z; 204 | } 205 | } 206 | 207 | ofVec3f ofxCoreMotion::getAccelerometerData() { 208 | return accelerometerData; 209 | } 210 | 211 | ofVec3f ofxCoreMotion::getGyroscopeData() { 212 | return gyroscopeData; 213 | } 214 | 215 | ofVec3f ofxCoreMotion::getMagnetometerData() { 216 | return magnetometerData; 217 | } 218 | 219 | float ofxCoreMotion::getRoll() { 220 | return roll; 221 | } 222 | 223 | float ofxCoreMotion::getPitch() { 224 | return pitch; 225 | } 226 | 227 | float ofxCoreMotion::getYaw() { 228 | return yaw; 229 | } 230 | 231 | ofQuaternion ofxCoreMotion::getQuaternion() { 232 | return attitudeQuat; 233 | } 234 | 235 | ofMatrix4x4 ofxCoreMotion::getRotationMatrix() { 236 | return rotMatrix; 237 | } 238 | 239 | ofVec3f ofxCoreMotion::getGravity() { 240 | return gravity; 241 | } 242 | 243 | ofVec3f ofxCoreMotion::getUserAcceleration() { 244 | return userAcceleration; 245 | } 246 | 247 | ofVec3f ofxCoreMotion::getMagneticField() { 248 | return magneticField; 249 | } 250 | -------------------------------------------------------------------------------- /ofxiOS-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIcons 14 | 15 | CFBundlePrimaryIcon 16 | 17 | CFBundleIconFiles 18 | 19 | Icon.png 20 | Icon@2x.png 21 | 22 | 23 | 24 | CFBundleIdentifier 25 | com.Neil.$(PRODUCT_NAME:identifier) 26 | CFBundleInfoDictionaryVersion 27 | 6.0 28 | CFBundleName 29 | ${PRODUCT_NAME} 30 | CFBundlePackageType 31 | APPL 32 | CFBundleShortVersionString 33 | 0.2a 34 | CFBundleSignature 35 | ???? 36 | CFBundleVersion 37 | 1.0 38 | LSRequiresIPhoneOS 39 | 40 | UIApplicationExitsOnSuspend 41 | 42 | UIStatusBarHidden 43 | 44 | UISupportedInterfaceOrientations 45 | 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | UIViewControllerBasedStatusBarAppearance 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /ofxiOS_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'iPhone' target in the 'iPhone' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /src/VrVideo.h: -------------------------------------------------------------------------------- 1 | // 2 | // VrVideo.hpp 3 | // VrVideo 4 | // 5 | // Created by Neil van Vuuren on 22/08/2015. 6 | // kalfie7@gmail.com 7 | // 8 | 9 | #ifndef _VrVideo_mm 10 | #define _VrVideo_mm 11 | 12 | #include "ofMain.h" 13 | #include "ofxCoreMotion.h" // iOs Orientation access 14 | 15 | 16 | #include 17 | 18 | 19 | class VrVideo{ 20 | 21 | public: 22 | void loadVideo(string videoName); 23 | // void setup(); // Load video. Check Stereo. 24 | void update(bool useCardboard,bool loop); 25 | void resetCamera(); 26 | void draw(bool useCardboard); 27 | void touchDown(int touchX, int touchY); 28 | void touchMoved(int touchX, int touchY,bool useCardboard); 29 | void touchUp(int touchX, int touchY); 30 | 31 | 32 | private: 33 | void setupEnvironment(); 34 | 35 | // Video load. 36 | ofVideoPlayer videoPano; 37 | 38 | 39 | //3d Components: 40 | 41 | ofSpherePrimitive monoSphere; 42 | ofSpherePrimitive stereoSphereLeft; 43 | ofSpherePrimitive stereoSphereRight; 44 | 45 | ofCamera camera; 46 | ofFbo leftEyeFBO; 47 | ofFbo righEyeFBO; 48 | 49 | 50 | //Stereo Scene Setup 51 | ofVec3f centrepoint; 52 | ofFbo fboMono; 53 | ofFbo fboCardboard; 54 | ofFbo fboLeft; 55 | ofFbo fboRight; 56 | 57 | 58 | // Phone Orientation 59 | ofxCoreMotion coreMotion; 60 | float spinX; 61 | 62 | 63 | // Stereo Logic Operators 64 | bool isStereo; // Used to check if video is in a stereoscopic format. 65 | bool isOU; // Set if Stereo is Over Under Encoded. 66 | bool isLR; // Set if Stereo is Left Right Encoded. 67 | 68 | 69 | 70 | bool videoisDone; //NOT USED 71 | 72 | ofVec2f firstTouch; 73 | int newTouchX; 74 | int newTouchY; 75 | int oldTouchX; 76 | int oldTouchY; 77 | float cameraRotationX; 78 | float cameraRotationY; 79 | ofQuaternion cameraHeading; 80 | ofQuaternion cameraPitch; 81 | bool firstRun; 82 | float oldPitch; 83 | }; 84 | 85 | #endif /* _Vr_Video_cpp */ 86 | -------------------------------------------------------------------------------- /src/VrVideo.mm: -------------------------------------------------------------------------------- 1 | // 2 | // VrVideo.cpp 3 | // VrVideo 4 | // 5 | // Created by Neil van Vuuren on 22/08/2015. 6 | // kalfie7@gmail.com 7 | // 8 | 9 | #include "VrVideo.h" 10 | 11 | 12 | //_________________________________________________________________Load the video by string and set up video environment 13 | void VrVideo::loadVideo(string videoName){ 14 | videoPano.loadMovie(videoName); 15 | ofSetOrientation(OF_ORIENTATION_90_LEFT); 16 | videoPano.play(); 17 | firstRun=true; 18 | 19 | isLR=false; 20 | isOU=false; 21 | isStereo=false; 22 | 23 | 24 | } 25 | 26 | void VrVideo::resetCamera(){ 27 | cameraRotationX=0; 28 | cameraRotationY=0; 29 | ofVec3f Znormal(0, 0, 1); 30 | ofVec3f HeadingNormal(1,0,0); 31 | ofVec3f HeadingReversed(-1,0,0); 32 | 33 | cameraHeading = ofQuaternion(cameraRotationX,Znormal); 34 | cameraPitch = ofQuaternion(cameraRotationY,HeadingNormal); 35 | } 36 | 37 | 38 | //_________________________________________________________________Load the FBO and render the scenes. 39 | 40 | 41 | 42 | void VrVideo::update(bool useCardboard, bool loop){ 43 | 44 | videoPano.update(); 45 | if (loop){ 46 | if (!(videoPano.isPlaying())){ 47 | videoPano.play(); 48 | } 49 | } 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | ofTranslate(ofGetWidth()/2, ofGetHeight()/2, 0); 58 | 59 | 60 | coreMotion.update(); 61 | 62 | ofQuaternion quat = coreMotion.getQuaternion(); //Gyroscope Set attitude of Camera! 63 | 64 | ofQuaternion landscapeFix(-quat.y(), quat.x(), quat.z(), quat.w()); // Correct rotation 65 | if (!useCardboard){ 66 | ofQuaternion cameraTotal; 67 | cameraTotal = cameraPitch * landscapeFix * cameraHeading ; 68 | camera.setOrientation(cameraTotal); 69 | } 70 | else{ 71 | camera.setOrientation(landscapeFix); 72 | } 73 | 74 | 75 | 76 | if(firstRun) 77 | { 78 | videoPano.setVolume((1.0f)); 79 | setupEnvironment(); 80 | firstRun=false; 81 | oldPitch = camera.getPitch(); 82 | } 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | videoPano.getTextureReference().bind(); //LOAD VIDEO as texture 91 | 92 | if (!isStereo){ 93 | //Draw a mono video and cardboard view 94 | if (!useCardboard){fboMono.begin();} 95 | if (useCardboard){fboCardboard.begin();} 96 | camera.begin(); 97 | monoSphere.draw(); 98 | if (useCardboard){fboCardboard.end();} 99 | if (!useCardboard){fboMono.end();} 100 | camera.end(); 101 | } 102 | 103 | if (isStereo){ 104 | 105 | if (!useCardboard){fboMono.begin();} //if no cardbaord draw MONO FBO 106 | if (useCardboard){fboLeft.begin();} //if Cardboard draw stereo left 107 | camera.begin(); 108 | stereoSphereLeft.draw(); 109 | if(useCardboard){fboLeft.end();} 110 | if(!useCardboard){fboMono.end();} 111 | camera.end(); 112 | 113 | if (useCardboard){ //if Cardboard draw stereo right 114 | fboRight.begin(); 115 | camera.begin(); 116 | stereoSphereRight.draw(); 117 | fboRight.end(); 118 | camera.end(); 119 | } 120 | 121 | } 122 | 123 | 124 | videoPano.getTextureReference().unbind(); 125 | 126 | //Stereo Sanity Check 127 | // Sometimes the video loads as mono even though it's stereo. Don't know why, this hack fixes it though. 128 | 129 | if ((videoPano.getWidth()/videoPano.getHeight()==1)){ 130 | if(!isStereo){ 131 | cout <<"VIDEO IS STEREO BUT SCENE IS MONO!!!!!! WHAT THE HELL MAN?!" << endl; 132 | setupEnvironment(); 133 | } 134 | } 135 | 136 | 137 | 138 | 139 | 140 | } 141 | 142 | //_________________________________________________________________DRAW 360 Video 143 | 144 | 145 | 146 | void VrVideo::draw(bool useCardboard){ 147 | 148 | if (!useCardboard) { 149 | fboMono.draw(0,0); 150 | } 151 | else if (useCardboard) { 152 | if (isStereo){ 153 | fboLeft.draw(0,0,ofGetScreenHeight()*0.5,ofGetScreenWidth()); 154 | fboRight.draw(ofGetScreenHeight()*0.5,0); 155 | 156 | } 157 | else{ 158 | fboCardboard.draw(0,0); 159 | fboCardboard.draw(ofGetScreenHeight()*0.5,0); 160 | } 161 | 162 | } 163 | 164 | 165 | 166 | } 167 | 168 | 169 | 170 | 171 | 172 | 173 | //_________________________________________________________________Rotate camera by Hand 174 | 175 | void VrVideo::touchDown(int touchX, int touchY){ 176 | 177 | oldTouchX = touchX; 178 | oldTouchY = touchY; 179 | 180 | } 181 | 182 | 183 | void VrVideo::touchMoved(int touchX, int touchY,bool useCardboard){ 184 | 185 | if (!useCardboard){ 186 | 187 | 188 | newTouchX = touchX; 189 | newTouchY = touchY; 190 | 191 | if (newTouchX != oldTouchX){ 192 | cameraRotationX+=(newTouchX-oldTouchX)*0.5; 193 | } 194 | if (newTouchY != oldTouchY){ 195 | cameraRotationY-=(newTouchY-oldTouchY)*0.5; 196 | } 197 | 198 | oldTouchX = touchX; 199 | oldTouchY = touchY; 200 | 201 | ofVec3f Znormal(0, 0, 1); 202 | ofVec3f HeadingNormal(1,0,0); 203 | ofVec3f HeadingReversed(-1,0,0); 204 | 205 | cameraHeading = ofQuaternion(cameraRotationX,Znormal); 206 | cameraPitch = ofQuaternion(cameraRotationY,HeadingNormal); 207 | 208 | if (abs((camera.getPitch())-(oldPitch)) > 170){ 209 | cout<<"flipped?"<enableHardwareOrientation(); 8 | // window->enableOrientationAnimation(); 9 | 10 | ofSetupOpenGL(1024,768,OF_FULLSCREEN); // <-------- setup the GL context 11 | ofRunApp(new ofApp()); 12 | } 13 | -------------------------------------------------------------------------------- /src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | #include "ofxiOS.h" 5 | #include "ofxiOSExtras.h" 6 | 7 | 8 | 9 | #include "VrVideo.h" 10 | 11 | 12 | class ofApp : public ofxiOSApp { 13 | 14 | public: 15 | void setup(); 16 | void update(); 17 | void draw(); 18 | void exit(); 19 | 20 | void touchDown(ofTouchEventArgs & touch); 21 | void touchMoved(ofTouchEventArgs & touch); 22 | void touchUp(ofTouchEventArgs & touch); 23 | void touchDoubleTap(ofTouchEventArgs & touch); 24 | void touchCancelled(ofTouchEventArgs & touch); 25 | 26 | void lostFocus(); 27 | void gotFocus(); 28 | void gotMemoryWarning(); 29 | void deviceOrientationChanged(int newOrientation); 30 | 31 | VrVideo mainVideo; 32 | 33 | bool useCardboard; 34 | bool loopVideo; 35 | 36 | 37 | 38 | 39 | 40 | }; 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/ofApp.mm: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | mainVideo.loadVideo("Bridge_2k.mp4"); //Loads the panoramic video 6 | useCardboard=false; //Start the video in Carboard mode? 7 | loopVideo=true; //Loop the video? 8 | 9 | 10 | } 11 | 12 | //-------------------------------------------------------------- 13 | void ofApp::update(){ 14 | mainVideo.update(useCardboard,loopVideo); 15 | } 16 | 17 | 18 | //-------------------------------------------------------------- 19 | void ofApp::draw(){ 20 | ofBackground(0,0,0); 21 | mainVideo.draw(useCardboard); 22 | 23 | 24 | } 25 | 26 | 27 | //-------------------------------------------------------------- 28 | void ofApp::exit(){ 29 | 30 | } 31 | 32 | //-------------------------------------------------------------- 33 | void ofApp::touchDown(ofTouchEventArgs & touch){ 34 | mainVideo.touchDown(touch.x, touch.y); //Mouse camera with finger if not in cardboard mode) 35 | } 36 | 37 | //-------------------------------------------------------------- 38 | void ofApp::touchMoved(ofTouchEventArgs & touch){ 39 | mainVideo.touchMoved(touch.x, touch.y,useCardboard); //Mouse camera with finger if not in cardboard mode) 40 | } 41 | 42 | //-------------------------------------------------------------- 43 | void ofApp::touchUp(ofTouchEventArgs & touch){ 44 | mainVideo.touchUp(touch.x, touch.y); //Mouse camera with finger if not in cardboard mode) 45 | } 46 | 47 | //-------------------------------------------------------------- 48 | void ofApp::touchDoubleTap(ofTouchEventArgs & touch){ 49 | useCardboard = !useCardboard; //Toggle Cardboard mode 50 | mainVideo.resetCamera(); //Reset camera to phone's orientation 51 | 52 | } 53 | 54 | //-------------------------------------------------------------- 55 | void ofApp::touchCancelled(ofTouchEventArgs & touch){ 56 | 57 | } 58 | 59 | //-------------------------------------------------------------- 60 | void ofApp::lostFocus(){ 61 | 62 | } 63 | 64 | //-------------------------------------------------------------- 65 | void ofApp::gotFocus(){ 66 | 67 | } 68 | 69 | //-------------------------------------------------------------- 70 | void ofApp::gotMemoryWarning(){ 71 | 72 | } 73 | 74 | //-------------------------------------------------------------- 75 | void ofApp::deviceOrientationChanged(int newOrientation){ 76 | 77 | 78 | 79 | } 80 | --------------------------------------------------------------------------------