2

I am building an iOS app using RealityKit. I would like to read a QR Code within ARView but cannot find any documentation/tutorials on it.

Any advice/guidance on doing this would be much appreciated! Thanks in advance.

mtreiber13
  • 63
  • 4

1 Answers1

0

In RealityKit you can RECOGNIZE a QR code or brand-new AppClipCode using image recognition technique. For this create AR Resources directory in Assets.xcassets and place JPEG or PNG images with QR codes there. You can use up to 100 images per project. Then use .image init for your anchor entity.

let anchor = AnchorEntity(.image(group: "AR Resources", name: "qrCodeImage"))
anchor.addChild(modelEntity)
arView.scene.anchors.append(anchor)

Since ARKit and RealityKit have similar capabilities under the hood, read this post for additional information.

But you can't READ any QR code (I mean extract an info contained in QR) using only RealityKit framework.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
  • Thank you for the reply. That makes a lot of sense. As a follow up question, if I have multiple objects that have the same exact appearance but want to differentiate them in RealityKit, how would you go about doing that? My idea was to use QR codes but it seems that will not work. – mtreiber13 Jul 24 '20 at 12:55
  • Hi @mtreiber13, please publish it as a new question (with a code you already wrote). – Andy Jazz Jul 24 '20 at 13:37