• Stars
    star
    261
  • Rank 156,630 (Top 4 %)
  • Language
    Swift
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

After Apple’s introduction of ARKit 2, we have been consistently working behind to create shared-AR experiences. Our goal is to improve the utility of mobile using AR experiences.

Bluetoothed ARKit 2.0 with ARWorldMap!

After Apple’s introduction of ARKit 2, we have been consistently working behind to create shared-AR experiences. Our goal is to improve the utility of mobile using AR experiences.

This demo created using ARKit 2:

  • Creates Geo-localized AR experiences on ARWorldMap
  • Detects objects and images
  • Mark specific objects and create 3D renders in point cloud
  • Share information locally over BLE (Bluetooth low energy)

Features in this demo:

  • Image tracking
  • Save and load maps
  • Detect objects
  • Environmental texturing

Prerequisites

Before we dive into the implementation details let’s take a look at the prerequisites of the course.

  • Xcode 10 (beta or above)
  • iOS 12 (beta or above)
  • Physical iPhone 6S or above

Image recognition and tracking

“A photo is like a thousands words” - words are fine, but, ARKit-2 turns a photo into thousands of stories.

Among the new dev features introduced in WWDC 2018, Image detection and tracking is one of the coolest. Imagine having the capability to replace and deliver contextual information to any static image that you see.

Image detection was introduced in ARKit 1.5, but the functionality and maturity of the framework was a bit low. But with this release, you can build amazing AR experiences. Take a look at the demo below:

alt text

  • Class : AVImageDetection.swift
let configuration = ARImageTrackingConfiguration()
let warrior = ARReferenceImage(UIImage(named: "DD")!.cgImage!,orientation: CGImagePropertyOrientation.up,physicalWidth: 0.90)
configuration.trackingImages = [warrior]
configuration.maximumNumberOfTrackedImages = 1

you can do custom action after image detect. We have added one GIF in replace of detected image.

func renderer(_ renderer: SCNSceneRenderer, nodeFor anchor: ARAnchor) -> SCNNode? {
        let node = SCNNode()
        if let imageAnchor = anchor as? ARImageAnchor {
            let plane = SCNPlane(width: imageAnchor.referenceImage.physicalSize.width, height: imageAnchor.referenceImage.physicalSize.height)
            plane.firstMaterial?.diffuse.contents = UIColor(white: 1, alpha: 0.8)
            let material = SCNMaterial()
            material.diffuse.contents = viewObj
            plane.materials = [material]
            let planeNode = SCNNode(geometry: plane)
            planeNode.eulerAngles.x = -.pi / 2
            node.addChildNode(planeNode)
        } else {
            if isFirstTime == true{
                isFirstTime = false
            } else {
                return node
            }
            let plane = SCNPlane(width: 5, height: 5)
            plane.firstMaterial?.diffuse.contents = UIColor(white: 1, alpha: 1)
            let planeNode = SCNNode(geometry: plane)
            planeNode.eulerAngles.x = .pi
            let shipScene = SCNScene(named: "art.scnassets/Sphere.scn")!
            let shipNode = shipScene.rootNode.childNodes.first!
            shipNode.position = SCNVector3Zero
            shipNode.position.z = 0.15
            planeNode.addChildNode(shipNode)
            node.addChildNode(planeNode)
        }
        return node
    }

Save and load maps

ARKit 2 comes with revolutionary ARWorldMap that allows persistent and multiuser AR experiences. In simpler words, you can use ARWorldMap to not only render AR experiences and render objects, but it also builds awareness about your user’s physical space and helps your app. This means that you can detect and standardise real world features in your iOS app.

You can then use these standardised features to place virtual content (funny GIFs anyone?) on your application.

We are going to build something like this

alt text Let’s dive into tech implementation.

First we are going to get the current world map from a user’s iPhone by using .getCurrentWorldMap(). We will save this session to get spatial awareness and initial anchors that were are going to share with another iPhone user.

  • Class : AVSharingWorldMapVC.swift
sceneView.session.getCurrentWorldMap { worldMap, error in
        guard let map = worldMap
        else { print("Error: \(error!.localizedDescription)"); return }
        guard let data = try? NSKeyedArchiver.archivedData(withRootObject: map, requiringSecureCoding: true)
        else { fatalError("can't encode map") }
        self.multipeerSession.sendToAllPeers(data)
}

Once, you get the session and world map related anchors from the first iPhone user. The app will now use Multipeer connectivity framework to push information on a P2P network to the 2nd iPhone user.

The code below shows how the second iPhone user would receive session sent over Multipeer. The 2nd iPhone user in this case would receive a notification using a receiver handler. Once the receive a notification, we can then get session data and render it in ARWorld.

func receivedData(_ data: Data, from peer: MCPeerID) {
        if let unarchived = try? NSKeyedUnarchiver.unarchivedObject(of: ARWorldMap.classForKeyedArchiver()!, from: data), let worldMap = unarchived as? ARWorldMap {
            // Run the session with the received world map.
            let configuration = ARWorldTrackingConfiguration()
            configuration.planeDetection = .horizontal
            configuration.initialWorldMap = worldMap
            sceneView.session.run(configuration, options: [.resetTracking, .removeExistingAnchors])
            mapProvider = peer
        }
}

If you wish to get a more hands on experience with Multi user AR experiences, Apple has a demo project just for that. You can download the demo here.

Object Detection

The new ARKit gives you the ability to scan 3D objects in the real world, creating a map of the scanned object that can be loaded when the object comes into view in the camera. Similar to the ARWorldMap object, ARKit creates a savable ARReferenceObject that can be saved and loaded during another session.

alt text

  • Class : AVReadARObjectVC.swift
 let configuration = ARWorldTrackingConfiguration()
 
 // ARReferenceObject(archiveURL :...   this method used when we have  ARReferenceObject Store in local Document Directory 
 configuration.detectionObjects = Set([try ARReferenceObject(archiveURL: objectURL!)])
 
 // ARReferenceObject.referenceObjects(inGroupNamed...   this method used when we have  ARReferenceObject Store in Assest Folder
 configuration.detectionObjects = ARReferenceObject.referenceObjects(inGroupNamed: "", bundle: .main)!
 
 sceneView.session.run(configuration)

When Object found this delegate method called.

   func renderer(_ renderer: SCNSceneRenderer, nodeFor anchor: ARAnchor) -> SCNNode? 

You can do You custom action in this delegate method.

Environment Texturing

In previous versions of ARKit, 3D objects placed in the real world didn’t have the ability to gather much information about the world around them. This left objects looking unrealistic and out of place. Now, with environmental texturing, objects can reflect the world around them, giving them a greater sense of realism and place. When the user scans the scene, ARKit records and maps the environment onto a cube map. This cube map is then placed over the 3D object allowing it to reflect back the environment around it. What’s even cooler about this is that Apple is using machine learning to generate parts of the cube map that can’t be recorded by the camera, such as overhead lights or other aspects of the scene around it. This means that even if a user isn’t able to scan the entire scene, the object will still look as if it exists in that space because it can reflect objects that aren’t even directly in the scene.

To enable environmental texturing, we simply set the configuration’s

environmentalTexturing property to .automatic.

Apple has created a project that can be used to scan 3D objects, and can be downloaded here

Inspired

This demo is created from Apple's ARKit 2 sample demo

More Repositories

1

flutter_showcaseview

Flutter plugin that allows you to showcase your features on flutter application. 👌🔝🎉
Dart
1,490
star
2

SSComposeCookBook

A Collection of major Jetpack compose UI components which are commonly used.🎉🔝👌
Kotlin
634
star
3

SSCustomTabbar

Simple Animated tabbar with native control
Swift
582
star
4

SSCustomBottomNavigation

Animated TabBar with native control and Jetpack Navigation support..✨🔖🚀
Kotlin
498
star
5

SSSpinnerButton

Forget about typical stereotypic loading, It's time to change. SSSpinnerButton is an elegant button with a different spinner animations.
Swift
428
star
6

flutter_credit_card

A credit card widget for Flutter application.
Dart
419
star
7

flutter_calendar_view

A Flutter package allows you to easily implement all calendar UI and calendar event functionality. 👌🔝🎉
Dart
416
star
8

SSffmpegVideoOperation

This is a library of FFmpeg for android... 📸 🎞 🚑
Kotlin
352
star
9

flutter_chatview

Highly customisable chat UI with reply and reaction functionality.
Dart
288
star
10

SSJetPackComposeProgressButton

SSJetPackComposeProgressButton is an elegant button with a different loading animations. 🚀
Kotlin
285
star
11

SSImagePicker

Easy to use and configurable library to Pick an image from the Gallery or Capture an image using a Camera... 📸
Kotlin
285
star
12

SSToastMessage

SSToastMessage is written purely in SwiftUI. It will add toast, alert, and floating message view over the top of any view. It is intended to be simple, lightweight, and easy to use. It will be a popup with a single line of code.
Swift
280
star
13

audio_waveforms

Use this plugin to generate waveforms while recording audio in any file formats supported by given encoders or from audio files. We can use gestures to scroll through the waveforms or seek to any position while playing audio and also style waveforms
Dart
277
star
14

react-native-story-view

A React Native component to show image and video stories ✨ 🎖
TypeScript
219
star
15

SSCustomEditTextOutLineBorder

Same as the Outlined text fields presented on the Material Design page but with some dynamic changes. 📝 🎉
Kotlin
207
star
16

Awesome-Mobile-Libraries

This repo contains all the Open-source Libraries from iOS, Android, Flutter and React-Native.✨
174
star
17

react-native-reactions

A React Native animated reaction picker component ✨✨
TypeScript
146
star
18

react-native-radial-slider

React Native component to select or highlight a specific value from a range of values 👌 ✨
TypeScript
139
star
19

SSPullToRefresh

SSPullToRefresh makes PullRefresh easy to use, you can provide your own custom animations or set simple gifs on refresh view. The best feature is Lottie animations in refresh view, it uses lottie animations to render high quality animations on pull refresh. 🎉💥
Kotlin
121
star
20

react-native-audio-waveform

React Native component to show audio waveform with ease in react native application ✨
TypeScript
120
star
21

react-native-spinner-button

React Native button component with multiple animated spinners
JavaScript
106
star
22

SSComposeShowCaseView

SSComposeShowCaseView is a customizable show case view library in Jetpack compose which allows to showcase/highlight the particular features of the application with an engaging overlay. It also provides automatic showcase view feature with customised delay and opacity attributes. 🎉💥
Kotlin
105
star
23

SSBiometricsAuthentication

Biometric factors allow for secure authentication on the Android platform.
Kotlin
102
star
24

react-native-animation-catalog

A collection of animated React Native components 🌟🔥
TypeScript
91
star
25

SSJetpackComposeSwipeableView

SSJetpackComposeSwipeableView is a small library which provides support for the swipeable views. You can use this in your lazyColumns or can add a simple view which contains swipe to edit/delete functionality.
Kotlin
91
star
26

SSSwiftUIGIFView

SSSwiftUIGIFView is a custom controller designed to help load GIFs in SwiftUI. It supports loading GIFs from remote URLs, is compatible with both iOS and macOS, and implements a caching mechanism to improve loading times and reduce data usage.
Swift
85
star
27

Kotlin-multiplatform-sample

A sample Kotlin Multiplatform project having native UI and shared bussiness logic on Android and iOS platforms.
Kotlin
84
star
28

SSCustomTabMenu

Customisable iOS bottom menu works like Tabbar
Swift
80
star
29

SSAndroidNeumorphicKit

Neomorphic UI kit for Android
Kotlin
72
star
30

SSCustomPullToRefresh

SSCustomPullToRefresh is an open-source library that uses UIKit to add an animation to the pull to refresh view in a UITableView and UICollectionView.
Swift
69
star
31

SSStepper

SwiftUI package for creating custom stepper with gesture controls and flexible design as per your choice.
Swift
67
star
32

SSAppUpdater

SSAppUpdater is an open-source framework that compares the current version of the app with the store version and returns the essential details of it like app URL, new app version number, new release note, etc. So you can either redirect or notify the user to update their app.
Swift
67
star
33

VonageVideoCalling_Android

Vonage Video Calling Android
Kotlin
64
star
34

SSExpandableRecylerView

Expandable Recyclerview makes it easy to integrate nested recycler view...🔨 📝
Kotlin
59
star
35

SSCustomSideMenu

Side Menu Custom Control for iOS apps
Swift
57
star
36

react-native-skia-catalog

A collection of animated React Native Skia components 🌟
TypeScript
56
star
37

SSArcSeekBar

Different type of arc seekbar. Easy to use and configure your own seekbar using all the attributes.
Kotlin
52
star
38

SSPlaceHolderTableView

SSPlaceholderTableView is Placeholder Library for different different state wise placeHolder for UITableView/UICollectionView. Check https://www.cocoacontrols.com/controls/ssplaceholdertableview
Swift
50
star
39

SSComposeOTPPinView

A custom OTP view to enter a code usually used in authentication. It includes different types of OTPViews which is easy to use and configure your own view and character of OTP using all the attributes. 📲 🔢 ✨
Kotlin
50
star
40

react-native-tree-selection

A high-performance and lightweight tree selection library for React Native🎖
TypeScript
45
star
41

SSVerticalPanoramaImage

Capture stunning vertical panorama images with ease and preview them instantly on the built-in screen.
Swift
44
star
42

SSFloatingLabelTextField

Swift
44
star
43

SSLineChart

SSLineChart provides you with the additional functionality of gradient color fill which cannot be found in any library specially Watchkit Libraries.
Swift
44
star
44

SSSwiftUISpinnerButton

SSSwiftUISpinnerButton is a collection of various spinning animations for buttons in SwiftUI.
Swift
43
star
45

SSNaturalLanguage

Swift
42
star
46

react-native-photos-gallery

A React Native custom animated photo gallery component to open and view photos ✨
TypeScript
41
star
47

react-native-country-code-select

A React Native component that allows users to select a country code ✨ 🔥
TypeScript
41
star
48

react-native-sticky-table

React Native sticky table component to elevate the app's data presentation and visualization experience ✨
TypeScript
40
star
49

Jetpack-compose-sample

Forget about bunch of XML files for maintaining UIs. Jetpack Compose is Android’s modern toolkit for building native UI. Here is a small example to get started.
Kotlin
38
star
50

SSMediaLibrary

Swift
38
star
51

SSCircularSlider

A simple, powerful and fully customizable circular slider, written in swift.
Swift
37
star
52

react-native-images-preview

A React Native animated custom image preview component ✨
TypeScript
36
star
53

SSCalendarControl

SSCalendarControl is small and highly customizable calendar control written in swift.
Swift
35
star
54

SSNeumorphicKit

Swift
35
star
55

SSSwiftyGo

Swift
35
star
56

flutter_vonage_video_call_demo

This application provides demo of one to one video call using Vonage Video API. Since there is no office support for flutter from voyage, this demo uses platform channel to communicate with native voyage SDK.
Kotlin
35
star
57

SSMultiSwipeCellKit

Swift
34
star
58

SSSwiper

SSSwiper is used to create swipe gestures action inside any view just by adding a modifier to the View with various customization options
Swift
31
star
59

SS-iOS-Animations

Elevate your app's user interface with stunning and smooth animations! This library offers easy-to-use animations for both SwiftUI beginners and pros. Enhance your app with cool transitions, fun effects, and interactive touches. Integrating these animations is simple—just follow a few steps to add the code and bring your project to life.
Swift
31
star
60

Fitness-App-ARKit

Fitness App build with ARKit.
Swift
30
star
61

tesseract-OCR-iOS-demo

This prototype is to recognize text inside the image and for that it uses Tesseract OCR. The underlying Tesseract engine will process the picture and return anything that it believes is text.
Swift
30
star
62

SSStoryStatus

SSStoryStatus: Elevate your SwiftUI projects with seamless user list integration and captivating story displays. Empowering developers with effortless integration and complete UI customization, this versatile library makes showcasing stories a breeze.
Swift
30
star
63

SSSwiftUISideMenu

SSSwiftUISideMenu: Your ultimate iOS side menu companion. This customizable and intuitive library facilitates seamless navigation within your app, offering left and right panel support. Effortlessly integrate and personalize UI elements and animation styles to elevate your user experience.
Swift
27
star
64

SSInstaFeedParser

A Flutter package allows you to fetch basic data from a Instagram profile url which is public and verified.
Dart
25
star
65

react-native-graph-kit

Personalized graphs featuring customizable options for React Native app 📈
TypeScript
23
star
66

SSFacebookLogin

The Reusable Facebook Login Components for iOS is the easiest way to get data from Facebook.
Swift
22
star
67

SSSceneFormSdkSample

This is an Augmented Reality Android app that is made by using ARcore and Sceneform SDK. 📸 🎉
Kotlin
20
star
68

battleship_flutter_flame

Dart
20
star
69

react-native-infinite-wheel-picker

Customizable wheel picker component for React Native, enabling infinite scrolling and intuitive item selection ✨
TypeScript
18
star
70

SSSwiftUILoader

A customisable, simple and elegant loader in SwiftUI.
Swift
15
star
71

SSCustomCameraControl

Custom camera control
Kotlin
15
star
72

Kotlin-Extensions

Library contains common extensions for Android
Kotlin
15
star
73

SSSwiftUIVideoLayerView

SSSwiftUIVideoPlayerLayer is a custom controller which helps to load video in SwiftUI.
Swift
14
star
74

SSProgressBar

Customizable progressbar
Swift
14
star
75

SSGoogleLogin

The GoogleSigninReusabelComponets for iOS is the easiest way to get data from Google .
Swift
14
star
76

CMPedometerDemo

Let's count steps using CMPedometer
Swift
14
star
77

SSAudioRecorderWithWaveForm

SSAudioRecorderWithWaveForm is recording audio with wave form. 🎉🎤
Kotlin
13
star
78

CreateFirebaseDynamicLinks

Swift
10
star
79

ios-commons

added few old helpers (need to updated) as initial version to work on
Swift
9
star
80

SSTwitterLogin

The reusable Twitter login components for iOS is the easiest way to get data from Twitter.
Swift
9
star
81

Workouts-TV-app

Swift
8
star
82

Game-With-AR

Swift
8
star
83

flutter_project_template

Dart
7
star
84

SSLinkedIn

Objective-C
7
star
85

MVVMListDemo

Swift
7
star
86

iOS-BarcodeScan

Objective-C
6
star
87

android-demos

Kotlin
5
star
88

SSSwiftUIVideoPlayerLayer

Swift
4
star
89

react-native-downloader

A audio video file downloader app with foreground and background download support
JavaScript
4
star
90

flutter_ss_placeholder_view

A Flutter package allows you to add placeholder content while loading or empty items.🚧
Dart
4
star
91

NewsApp-RIBs

News app with Listview and Pageview using uber's RIBs Architecture
Swift
3
star
92

SwiftUI-Combine-MVVM

Swift
3
star
93

MVVMDemo

Architecture of iOS Application, Swift
Swift
2
star
94

BiometricReactNative

Biometric authentication with react-native app
JavaScript
2
star
95

DFPDemo

For showing Ad's , Swift
Swift
2
star
96

Kotlin-CoRoutines

Kotlin
2
star
97

QualityCodeSample

Swift
2
star
98

Android_Project_Setup

Kotlin
2
star
99

GoogleLogin

Swift
2
star
100

android_simform_sample_app

The sample app uses Github's GraphQL APIs to query the Simform's Github repositories and list them using compose views in the Android application.
Kotlin
2
star