Git Product home page Git Product logo

gvrscnrenderer's Introduction

GVRSCNRenderer

CocoaPods CocoaPods license

Combines Google Cardboard with SceneKit Rendering and ARKit World Tracking.
Combining ARKit with Google Cardboard enables six degrees of freedom (rotation and translation) in VR:

Cardboard+ARKit

Installation

GVRSCNRenderer can be installed as a dependency using CocoaPods:

target 'Your-App-Name' do
	use_frameworks!
	pod 'GVRSCNRenderer'
end

Usage

Builds on top of GVRRenderer from GVRKit, which is part of the Google VR SDK for iOS.

Basic Setup

import GVRKit
import GVRSCNRenderer

// Create scene:
let scene: SCNScene = ...

// For SceneKit Rendering without world tracking:
let renderer = GVRSCNRenderer(scene: scene)

// For 6DOF Tracking:
let renderer = GVRSCNARTrackingRenderer(scene: scene)

// Create Cardboard view and pass renderer
let view = GVRRendererView(renderer: renderer)

Event Handling

Cardboard trigger events can be handled by the interaction delegate:

renderer.interactionDelegate = yourEventHandler

extension YourEventHandler: GVRSCNInteractionDelegate {
	func didTrigger(_ renderer: GVRSCNRenderer, headTransform: SCNMatrix4) {
		// Handle trigger event
	}
}

Render Loop Customization

The render loop can be customized using a SCNSceneRendererDelegate:

renderer.rendererDelegate = yourRendererDelegate

extension YourRendererDelegate: SCNSceneRendererDelegate {
	// ...
}

Showing Tracking Features

Tracking features can be shown to signal nearby objects in the real world to the user to avoid collisions (GVRSCNARTrackingRenderer only):

renderer.showsTrackingFeatures = true

Customizing feature indicators:

// Set tracking feature size in meters (e.g. 0.001 == 1mm)
renderer.trackingFeatureSize = ...

// Set tracking feature material
renderer.trackingFeatureMaterial = ...

3D Model in demo GIF: Rempart Walls scenery 1 - Fougères castle by noxfcna is licensed under CC Attribution

gvrscnrenderer's People

Contributors

palle-k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

caffeinum

gvrscnrenderer's Issues

Use with ARKit3

I am trying to associate ARSCNView with rendering of GVRSCNARTrackingRenderer and when I try to specify let renderer = GVRSCNARTrackingRenderer (scene: arView.scene), I get no result. In addition, when you press the Cardboard button on the screen, even when you try to add a normal SCNScene, screen separation does not occur. Tell me how to correctly implement the presentation functionality with a split screen for two eyes, while showing ARSCNView?

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.