All Projects → maxxfrazer → SceneKit-PortalMask

maxxfrazer / SceneKit-PortalMask

Licence: MIT license
Clean class to create a portal in SceneKit for use in ARKit.

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to SceneKit-PortalMask

GVRSCNRenderer
SceneKit Rendering and ARKit 6DOF Tracking for Google Cardboard
Stars: ✭ 19 (-68.33%)
Mutual labels:  augmented-reality, scenekit, arkit
Scenekit Scnline
Draw a tube or thick line in SceneKit
Stars: ✭ 49 (-18.33%)
Mutual labels:  augmented-reality, scenekit, arkit
Unity-ARKit-Plugin
Modified plugin source and Add custom ARKit projects implement on Unity
Stars: ✭ 83 (+38.33%)
Mutual labels:  augmented-reality, scenekit, arkit
Arkit Projects
Experimenting with ARKit
Stars: ✭ 70 (+16.67%)
Mutual labels:  augmented-reality, scenekit, arkit
Arkit Floorislava
Basic ARKit example that detects planes and makes them lava.
Stars: ✭ 120 (+100%)
Mutual labels:  augmented-reality, scenekit, arkit
TheLaughingMan-ARKit
Use ARKit to become the infamous Laughing Man from Ghost in the Shell
Stars: ✭ 26 (-56.67%)
Mutual labels:  augmented-reality, scenekit, arkit
ARKit-Sample-ObjC
ARKit sample application is written in Objective C with features of Add, Remove, Scale, Move, Snapshot for single and multiple objects with plane/surface detection, reset session and AR support checking.
Stars: ✭ 72 (+20%)
Mutual labels:  augmented-reality, scenekit, arkit
Augmentedsolarsystem
An Augmented reality experience to explore planets in our Solar System
Stars: ✭ 69 (+15%)
Mutual labels:  augmented-reality, scenekit, arkit
Arkit By Example
Apple ARKit example app
Stars: ✭ 458 (+663.33%)
Mutual labels:  augmented-reality, scenekit, arkit
Arkit Scnpath
Create paths for your Augmented Reality environments using just points to represent the centre of the path.
Stars: ✭ 312 (+420%)
Mutual labels:  augmented-reality, scenekit, arkit
Argithubcommits
Show your GitHub commit records in 3D with ARKit and SceneKit. 用 ARKit 展示你的 GitHub 提交图
Stars: ✭ 280 (+366.67%)
Mutual labels:  augmented-reality, scenekit, arkit
ARKit-FocusNode
FocusSquare class taken straight from Apple's ARKit examples and packed up for anyone to use with ease.
Stars: ✭ 50 (-16.67%)
Mutual labels:  augmented-reality, scenekit, arkit
Arpaint
Draw with bare fingers in the air using ARKit
Stars: ✭ 672 (+1020%)
Mutual labels:  augmented-reality, scenekit, arkit
Arplayer
Playback videos using ARKit and AVFoundation.
Stars: ✭ 117 (+95%)
Mutual labels:  augmented-reality, scenekit, arkit
Tom and Jerry
A multiuser AR game based on ARKit 2 and MultipeerConnectivity
Stars: ✭ 24 (-60%)
Mutual labels:  scenekit, arkit
Arvisualizer
Prototype of a real-time visualization tool for ARKit sessions
Stars: ✭ 102 (+70%)
Mutual labels:  augmented-reality, arkit
React Arkit
AR library for React-Native based on ARKit
Stars: ✭ 57 (-5%)
Mutual labels:  augmented-reality, arkit
Arkitgamespritekit
A game inspired by Pokemon Go build with ARKit and SpriteKit
Stars: ✭ 87 (+45%)
Mutual labels:  augmented-reality, arkit
Arkit 2 Image Tracking Demo
iOS 12 + ARKit 2 + Image tracking means: Harry Potter style moving pictures, living movie posters, video postcards, paper-thin “displays,” and lots more augmented reality fun.
Stars: ✭ 102 (+70%)
Mutual labels:  augmented-reality, arkit
Xr Unity
8th Wall XR Unity projects and resources. Feel free to contribute!
Stars: ✭ 108 (+80%)
Mutual labels:  augmented-reality, arkit

SceneKit-PortalMask

Version License Platform Swift 5.0 Build Status

See my Medium post about this CocoaPod

This class PortalMask creates an occluding box around any rectangular frame, including a tracking image, which turns the tracking image or any static area into an Augmented Reality portal into a scene you can define inside that area that can be seen by looking through the defined portal. This can also be used to have the illusion of a hole in the ground.

Include this pod in your project: pod 'PortalMask'

The following example code creates a portal ontop of a tracking marker, similar to the example gif.

func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) {
	if let imageAnchor = anchor as? ARImageAnchor {
		let nodeRotated = SCNNode()
		nodeRotated.eulerAngles.x = -.pi / 2
		// the next 2 lines add the portal
		let portal = PortalMask(frameSize: imageAnchor.referenceImage.physicalSize)
		nodeRotated.addChildNode(portal)

		// the next 4 lines add a cube inside the image area
		let width = imageAnchor.referenceImage.physicalSize.width
		let boxNode = SCNNode(geometry: SCNBox(width: width, height: width, length: width, chamferRadius: 0))
		boxNode.position.z = -boxNode.width
		nodeRotated.addChildNode(boxNode)

		node.addChild(nodeRotated)
	}
}

Also contains functions for circular holes:

let portal = PortalMask(radius: imageAnchor.referenceImage.physicalSize.width)

And any other polygon by feeding coordinates. This example will make a triangular portal:

let portal = PortalMask(path: [CGPoint(x: 1, y: -1), CGPoint(x: 0, y: 1), CGPoint(x: -1, y: -1)])

Here's some basic examples of what you can do with this Pod:

Tracking Portal Example Flappy Bird Example

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].