All Projects → StephenGuanqi → Unity-ARKit-Plugin

StephenGuanqi / Unity-ARKit-Plugin

Licence: GPL-3.0 license
Modified plugin source and Add custom ARKit projects implement on Unity

Programming Languages

C#
18002 projects
Objective-C++
1391 projects
ShaderLab
938 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to Unity-ARKit-Plugin

Argithubcommits
Show your GitHub commit records in 3D with ARKit and SceneKit. 用 ARKit 展示你的 GitHub 提交图
Stars: ✭ 280 (+237.35%)
Mutual labels:  augmented-reality, scenekit, arkit
Arkit By Example
Apple ARKit example app
Stars: ✭ 458 (+451.81%)
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 (-13.25%)
Mutual labels:  augmented-reality, scenekit, arkit
SceneKit-PortalMask
Clean class to create a portal in SceneKit for use in ARKit.
Stars: ✭ 60 (-27.71%)
Mutual labels:  augmented-reality, scenekit, arkit
TheLaughingMan-ARKit
Use ARKit to become the infamous Laughing Man from Ghost in the Shell
Stars: ✭ 26 (-68.67%)
Mutual labels:  augmented-reality, scenekit, arkit
GVRSCNRenderer
SceneKit Rendering and ARKit 6DOF Tracking for Google Cardboard
Stars: ✭ 19 (-77.11%)
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 (+275.9%)
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 (-39.76%)
Mutual labels:  augmented-reality, scenekit, arkit
Augmentedsolarsystem
An Augmented reality experience to explore planets in our Solar System
Stars: ✭ 69 (-16.87%)
Mutual labels:  augmented-reality, scenekit, arkit
Scenekit Scnline
Draw a tube or thick line in SceneKit
Stars: ✭ 49 (-40.96%)
Mutual labels:  augmented-reality, scenekit, arkit
Arpaint
Draw with bare fingers in the air using ARKit
Stars: ✭ 672 (+709.64%)
Mutual labels:  augmented-reality, scenekit, arkit
Arplayer
Playback videos using ARKit and AVFoundation.
Stars: ✭ 117 (+40.96%)
Mutual labels:  augmented-reality, scenekit, arkit
Arkit Projects
Experimenting with ARKit
Stars: ✭ 70 (-15.66%)
Mutual labels:  augmented-reality, scenekit, arkit
Arkit Floorislava
Basic ARKit example that detects planes and makes them lava.
Stars: ✭ 120 (+44.58%)
Mutual labels:  augmented-reality, scenekit, arkit
ARKitXamarinDemo
ARKit + UrhoSharp + Xamarin
Stars: ✭ 42 (-49.4%)
Mutual labels:  augmented-reality, arkit
obj2usdz
🦖 obj2usdz, convert .OBJ files to .USDZ on iOS
Stars: ✭ 56 (-32.53%)
Mutual labels:  augmented-reality, arkit
Tom and Jerry
A multiuser AR game based on ARKit 2 and MultipeerConnectivity
Stars: ✭ 24 (-71.08%)
Mutual labels:  scenekit, arkit
ARMultiuser
this demo use arkit 2.0, realize multiplayer play together! The project refers to the official demo!
Stars: ✭ 30 (-63.86%)
Mutual labels:  scenekit, arkit
iOS-ARKit
Basic Concepts and Projects using ARKit on iOS.
Stars: ✭ 18 (-78.31%)
Mutual labels:  augmented-reality, arkit
ARichMan
Use ARKit to realize your dream of becoming rich.
Stars: ✭ 19 (-77.11%)
Mutual labels:  scenekit, arkit

Unity-ARKit-Plugin

License: GPL v3

Modified plugin source and add custom ARKit projects implemented by Unity

Introduction

The unity-arkit-plugin enables using all the functionality of the ARKit SDK simply within your Unity projects for iOS. The plugin exposes ARKit SDK's world tracking capabilities, rendering the camera video input, plane detection and update, point cloud extraction, light estimation, and hit testing API to Unity developers for their AR projects. For more information, you can go to the official repo for downloading.

This repository has two extensions for the official plugin. First it modifies the existing UnityARKitScene project to change it to a zombie walk AR application. The app support hitTest function, changing the zombie's euler angle and pos, as well as scaling the zombie up and down with walking animation. Second the repository has make changes to the plugin's source code in the NativeInterface folder, in order to get the captured image CVPixelBuffer from the ARFrame object, as well as the camera pos, timestamp, lightestimation, etc. and saved those info into the native document directory of the app container asyncronously. And the UnityARRecorder app has realize this function.

Environment Requirements:

  • Xcode 9 that contains ARKit framework
  • iOS 11
  • iOS devices that support A9 or better processor for ARWorldTrackingSessionConfiguration (iPhone6s or higher)
  • Unity v5.6.1p1+ with iOS plugin

Usage

  1. $ git clone https://github.com/StephenGuanqi/Unity-ARKit-Plugin.git
  2. Create a new empty project in your Unity, and drag the unity-arkit-plugin.unitypackage into your project.
  3. You could see multiple unity projects whose names start with UnithyAR
  4. Try any projects and made modifications you like, and build with the iOS plugin.
  5. Open the XCode projects, add the CoreImage framework and finish building.

Extended Projects

ZombieWalk

gif

The project enables cloudpoint and plane detection, and perform hitTest against existing plane to change the zombie's transform. It also changes the zombie's euler angle to face towards the position of the camera in world coordinates.

UnityARRecorder

gif

The ARSessionNative.mm in the plugin source code export various functions to C# layer to let users configure the ARSession using C#, and in turn the objective-C++ class take the passed in paramters and conduct processing like parsing the UnityARKitWorldTrackingConfiguration and set it to the ARSession, or transforming left-hand coordinates(Unity) to right-hand coordinaets(ARKit).

The core in ARSessionNative.mm is that it provides callback method for ARFrame update and ARAnchor update. This callback is intended to be implemented by user in C#, and when the ARFrame and ARAnchor id updated, the corresponding delegate method in objective-c like (void)session:(ARSession *)session didUpdateFrame:(ARFrame *)frame and (void)session:(ARSession *)session didAddAnchors:(NSArray<ARAnchor*>*)anchors will call the callback function and passed in the ARFrame and ARAnchor parameter.

However, the official plugin provides many interfaces for the native ARKit API, except for method to get CVPixelBuffer in ARFrame. The ARSessionNative.mm only gives user the opportunity to manipulate the ARCamera, not the ARFrame, therefore it's hard for us to get the captured image and conduct our own research.

This repository has modified the ARSessionNative.mm and UnityARSessionNativeInterface, meanwhile added ARFrameHandler class to get and convert the CVPixelBuffer to UIImage, save it to jpg file, and save the camera pos and other info into json file every time the frame is updated.

The sample json file is as follows:

{
  "27255.603090583.jpg" : {
    "lightEstimate" : 944.16241455078125,
    "imageResolution" : {
      "width" : 1280,
      "height" : 720
    },
    "timeStamp" : "27255.603090583",
    "cameraPos" : {
      "x" : -0.0040707914158701897,
      "y" : 0.0039433315396308899,
      "z" : 0.0042630583047866821
    },
    "cameraTransform" : [
      [
        0.83647698163986206,
        -0.21551112830638885,
        0.50384646654129028,
        -0.0040707914158701897
      ],
      [
        0.084991201758384705,
        0.95931828022003174,
        0.26923003792762756,
        0.0039433315396308899
      ],
      [
        -0.54137128591537476,
        -0.18238219618797302,
        0.82076418399810791,
        0.0042630583047866821
      ],
      [
        0,
        0,
        0,
        1
      ]
    ],
    "cameraIntrinsics" : [
      [
        1088.72119140625,
        0,
        639.5
      ],
      [
        0,
        1088.72119140625,
        359.5
      ],
      [
        0,
        0,
        1
      ]
    ],
    "imageName" : "27255.603090583.jpg",
    "cameraEulerAngle" : {
      "x" : -0.27259346842765808,
      "y" : 0.55055916309356689,
      "z" : 0.088364705443382263
    }
  }
}

You can find more sample json and image data in the sampleAppContainer.xcappdata.

Original Official Projects

ParticlePainter

gif The app paint the gameobject only when the distance between the current camera transform and the previous camera transform is larger than the threshold.

ARBallz

gif The app put balls on the coordinates derived by the hitTest result, when a plane has been detected.

Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Thanks

Augmented Reality Tutorial: APPLE ARkit is AMAZING!!!

License

This custom Unity-ARKit-Plugin is under GNU GPL v3.0 License. SEE LICENSEfor details.

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].