All Projects → BlackMirrorz → Arkitbusinesscard

BlackMirrorz / Arkitbusinesscard

A Basic Example Creating An Interactive Business Card In ARKit2.

Programming Languages

swift
15916 projects
swift4
162 projects

Projects that are alternatives of or similar to Arkitbusinesscard

Arkit Emperor
Power! Unlimited power for ARKit 2.0!
Stars: ✭ 464 (+1306.06%)
Mutual labels:  arkit, scenekit
Arkit Scnpath
Create paths for your Augmented Reality environments using just points to represent the centre of the path.
Stars: ✭ 312 (+845.45%)
Mutual labels:  arkit, scenekit
Argithubcommits
Show your GitHub commit records in 3D with ARKit and SceneKit. 用 ARKit 展示你的 GitHub 提交图
Stars: ✭ 280 (+748.48%)
Mutual labels:  arkit, scenekit
ARVoxelKit
Voxel graphics framework using ARKit + SceneKit
Stars: ✭ 74 (+124.24%)
Mutual labels:  scenekit, arkit
Arpaint
Draw with bare fingers in the air using ARKit
Stars: ✭ 672 (+1936.36%)
Mutual labels:  arkit, scenekit
SCNNodeVisualDebugger
A simple visual debugger for SceneKit
Stars: ✭ 18 (-45.45%)
Mutual labels:  scenekit, arkit
Arkit By Example
Apple ARKit example app
Stars: ✭ 458 (+1287.88%)
Mutual labels:  arkit, scenekit
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 (+118.18%)
Mutual labels:  scenekit, arkit
Arkit Line Drawing
Changed the default ARKit project to draw a line where the camera is positioned
Stars: ✭ 390 (+1081.82%)
Mutual labels:  arkit, scenekit
Arkit Tictactoe
Tic-Tac-Toe implemented using ARKit+Scenekit
Stars: ✭ 382 (+1057.58%)
Mutual labels:  arkit, scenekit
SCNHighlight
Scale-invariant highlight effect for SCNNodes based on SCNTechnique
Stars: ✭ 20 (-39.39%)
Mutual labels:  scenekit, arkit
Arsolarplay
通过ARKit实现的太阳系动画
Stars: ✭ 593 (+1696.97%)
Mutual labels:  arkit, scenekit
ARBlockTower
Submission for WWDC 2018 Scholarship formatted into an iOS app
Stars: ✭ 24 (-27.27%)
Mutual labels:  scenekit, arkit
Arbottlejump
An ARKit version of WeChat Bottle Jump game. ARKit 版微信跳一跳游戏
Stars: ✭ 259 (+684.85%)
Mutual labels:  arkit, scenekit
ARKitPlusVR
Make VR with SceneKit & ARKit.
Stars: ✭ 83 (+151.52%)
Mutual labels:  scenekit, arkit
Arkit
ARKit Base Project. Place virtual objects based on WWDC example project
Stars: ✭ 297 (+800%)
Mutual labels:  arkit, scenekit
ARKitSceneKitExample
Simple AR app made with ARKit and SceneKit
Stars: ✭ 53 (+60.61%)
Mutual labels:  scenekit, arkit
ARKit-SceneKit-Paint-Tiltbrush-Demo
Demo paint app with ARKit and SceneKit
Stars: ✭ 33 (+0%)
Mutual labels:  scenekit, arkit
Arkit Occlusion
A demonstration of vertical planes "tracking" and occlusions with ARKit+Scenekit
Stars: ✭ 341 (+933.33%)
Mutual labels:  arkit, scenekit
3dsnakear
Well known game Snake written in Swift using ARKit.
Stars: ✭ 453 (+1272.73%)
Mutual labels:  arkit, scenekit

ARKit Business Card

This project is a basic example of creating a fully interactive business card in ARKit.

The app uses ARImageTrackingConfiguration to detect the business card and then present interactive content.

As with all my work, the code is fully commented (probably way too much!) so it should be very easy to follow.

Branches:

The Master Branch was originally compiled in XCode10 Beta using Swift 4.

An updated Branch called 'Swift4.2' contains the project built in XCode 10.5 Beta and uses Swift 4.2.

Requirements:

The project is setup for iPhone, and in Portait Orientation.

Notes: If you want to use this project on IOS11.4 you will need to change the ARImageTrackingConfiguration to ARWorldTrackingConfiguration and make some minor tweaks to the Configuration settings in the ViewController, all of which are very trivial.

Some people have had some issues with SideMenu. If I remember correctly, I had to manually change a few of the names, as some have changed in later versions of Swift. Again these are all very trivial!

Using The Templates:

In the templates folder of this repository there are 2 files:

  1. businessCardPrint.png
  2. businessCardTemplate.ai

To get up and running you can print out the businessCardPrint.png or even display it in preview to test the apps functionality. Currently this is sized at 10cm by 5cm, although of course you can change this as you wish!

The template ai file is provided so you can make your own business cards.

The image below shows the SCNScene Business Card template:

The semi transparent area is the actual size of our business card (imageTarget) as such you can change and organise things as you wish.

Business Card Template

The use of a template makes the creation of interactive business cards simple, without the need for manually calculating the position of interactive buttons, and labels etc. And means that you can easily configure the app to detect as many different business cards as you need.

There are 2 Templates:

  1. BusinessCardTemplateA (which doesn't show the users image),
  2. BusinessCardTemplateB (which shows the users image).

If you are using the 1st template you must currently provide an image, which for the sake of simplicity; add an image of the cardholder to the Assetts folder and name it like so: firstname+surname e.g. JoshRobbins.png

The BusinessCardData Struct formats all the data needed for each element of the business card to work:

struct BusinessCardData{

   var firstName: String
   var surname: String
   var position: String
   var company: String
   var address: BusinessAddress
   var website: SocialLinkData
   var phoneNumber: String
   var email: String
   var stackOverflowAccount: SocialLinkData
   var githubAccount: SocialLinkData
}

struct BusinessAddress{

    var street: String
    var city: String
    var state: String
    var postalCode: String
    var coordinates: (latittude: Double, longtitude: Double)
}

enum SocialLink: String{

    case Website
    case StackOverFlow
    case GitHub
}

A BusinessCard is initialised like so:

/// Creates The Business Card
///
/// - **Parameters**:
/// - data: BusinessCardData
/// - cardType: CardTemplate
init(data: BusinessCardData, cardType: CardTemplate) {
}

Whereby the data argument takes the data needed to populate the template and the cardType takes either of the following values:

case noProfileImage
case standard

As such generating a BusinessCard (which is an SCNNode subclass) is as simple as this:

extension  ViewController: ARSCNViewDelegate{

func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) {

    //1. Check We Have A Valid Image Anchor
    guard let imageAnchor = anchor as? ARImageAnchor else { return }

   //2. Get The Detected Reference Image
   let referenceImage = imageAnchor.referenceImage

  //3. Load Our Business Card
  if let matchedBusinessCardName = referenceImage.name, matchedBusinessCardName == "BlackMirrorz"{

     //4. Create Our Business Card
     let businessCardData = BusinessCardData(firstName: "Josh",
     surname: "Robbins",
     position: "Software Engineer",
     company: "BlackMirrorz",
     address: BusinessAddress(street: "1 Infinite Loop",
     city: "Cupertino",
     state: "CA",
     postalCode: "95015",
     coordinates: (latittude: 37.3349, longtitude: -122.0090201)),
     website: SocialLinkData(link: "https://www.blackmirrorz.tech", type: .Website),
     phoneNumber: "+821076337633",
     email: "[email protected]",
     stackOverflowAccount: SocialLinkData(link: "https://stackoverflow.com/users/8816868/josh-robbins", type: .StackOverFlow),
     githubAccount: SocialLinkData(link: "https://github.com/BlackMirrorz", type: .GitHub))

     //5. Assign It To The Business Card Node
     let businessCard = BusinessCard(data: businessCardData, cardType: .noProfileImage)
     businessCardPlaced = true
     node.addChildNode(businessCard)
     
   }
  }
}

When the business card is detected, the Firstname and Surname of the card holder is animated with a typing like effect, and the buttons are animated as well.

Interactive Elements:

Each button performs a different function: ARKit Business Card Icons

  • The StackOverFlow Button presents a slide out WKWebView to display the users StackOverFlow Account.
  • The GitHub Button presents a slide out WKWebView to display the users GitHub Account.
  • The Internet Button presents a slide out WKWebView to display the users website.
  • The Phone Button allows the user to call the Business Telephone Number.
  • The SMS Button presents an MFMessageComposeViewController allowing the user to send a text message to the business.
  • The Email Button presents an MFMailComposeViewController allowing the user to email the business.
  • The Contact Button creates a CNMutableContact and saves the business as a new contact on the users device.
  • The Location Button presents a slide out MKMapView to display the users Businesses Location.

Repositories Used:

Since rendering a WKWebView as an SCNMaterial isn't possible, I had to look at other ways to allow the content to be fully interactive.

As such I made use of the fabulous repository SideMenu by Jonkykong which is available here: SideMenu

This allows the user to still experience ARKit whilst allowing an almost split screen like effect:

ARKit Business Card Split Screen

To Do:

Allow the user to create a business card within the app.

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