GithubHelp home page GithubHelp logo

thepowerofswift / gvr-scenekit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andrianbdn/gvr-scenekit

0.0 0.0 0.0 493 KB

Example of iOS SceneKit + Google VR SDK app

License: Other

Ruby 0.24% Swift 74.28% Objective-C 25.48%

gvr-scenekit's Introduction

GVR-SceneKit

This is an example of using Apple SceneKit with iOS Google Virtual Reality SDK for using with Google Cardboard.

Currently (early June 2016 April 2017) it is the easiest way to develop VR app on the iPhone. Hope this is going to change after WWDC 2016 2017.

The project codename is ’VRBoilerplate’ and initially it was prepared for iOS programming competition for uadevchallenge 2016. It supports both Objective-C and Swift.

Installing

Install CocoaPods, open VRBoilerplate.xcworkspace, start coding.

Usage

To create and manage scene, you need to implement a class based on VRControllerProtocol.

Than specify that class in Info.plist under VRControllerClass key.

If you’re using Swift, you need to specify Obj-C runtime class name

@objc(VRControllerSwift)
class VRControllerSwift : NSObject, VRControllerProtocol {
// ...

VRControllerProtocol

Very simple protocol that contains init-constructor and three methods.

- scene

Read-only property that should return SCNScene. Can’t be null, the scene should not be changed during VRController object lifetime.

- prepareFrameWithHeadTransform:

The method is called before each frame (one time for both eyes). Argument is head rotation from GVR SDK.

You can use prepareFrameWithHeadTransform: as a game loop body.

- eventTriggered

This method is called when magnet on Cardboard is ‘clicked’ (or if there there are tap on Simulator window)

Implementation Details

  • Viewer is at the point (0, 0, 0) looking around. The project does not takes into account SCNCamera objects in Scene. After app start the viewer is looking at the direction (0, 0, -1). The direction which viewer is holding Cardboard in the real word is going to be (0, 0, -1) in VR.

  • There are number of problems with integration of GVR and SceneKit. Since GVR is closed source, they are more like ‘known issues’ like now.

    • reflectivity (.reflectivity > 0) does not work for SCNFloor

    • SpriteKit scenes are not working as a materials

    • There are two warning during build: … direct access in gvr::Singleton gvr::ServerLogger ::GetInstance() to global weak symbol — see issue in GVR project.

gvr-scenekit's People

Contributors

andrianbdn avatar cwei avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.