Questions tagged [realitykit]

Apple RealityKit is a high-level framework that helps a developer to load and render AR/VR models with PBR shaders, animations and physics simulations for iOS, visionOS and macOS apps.

RealityKit is an Apple framework for building, animating and rendering 3D scenes. It was introduced at WWDC 2019 for iOS and macOS, and at WWDC 2023 for visionOS. RealityKit allows us implement a high-performance life-like 3D simulation, or fulfil a physically based rendering for its companion – and frameworks – to seamlessly integrate virtual objects into the real world.

RealityKit was built from the ground up for Augmented Reality apps, and it shines with and . Using this framework you can asynchronously load assets in .usdz and .reality formats, or in .rcproject format that stores compositions of app. Starting from Xcode 15, there will be the Reality Composer Pro app.

References

795 questions
6
votes
3 answers

Dynamically change text of RealityKit entity

I have created a very simple scene ("SpeechScene") using Reality Composer, with a single speech callout object ("Speech Bubble") anchored to a Face anchor. I have loaded this scene into code via the following: let speechAnchor = try!…
lreichold
  • 755
  • 12
  • 27
6
votes
2 answers

RealityKit only displays dark images

I am working on an iOS App with ARKit 3 and RealityKit. I want to create virtual 2d planes within the room containing images. Therefore I used Adding a material to a ModelEntity programmatically But images which aren't nearly white will get…
6
votes
1 answer

RealityKit – Set text programmatically of an Entity of Reality Composer

In my iOS app I want to introduce a part of AR using the new Reality Composer. In my project I load a scene with this code: let arView = ARView.init(frame: frame) // Configure the AR session for horizontal plane tracking. let arConfiguration =…
BlackRock
  • 421
  • 1
  • 5
  • 18
5
votes
1 answer

Disable live camera feed in ARSCNView?

Is there any way to disable the live camera feed and pass the custom video as input in ARSession? I want to achieve Record & Replay ARSession by code.
5
votes
1 answer

ARKit, AnchorEntity, missing initialiser(s)

Learning about the ARKit, I am watching all the AR WWDC content. In Introducing ARKit 3, where RealityKit is used for the first time, there is an example of using AnchorEntity with the 3rd convenience initializer from the first screenshot…
Jakub Gawecki
  • 801
  • 2
  • 6
  • 14
5
votes
1 answer

RealityKit – Load ModelEntity from web URL resource

I was wondering if someone know is it possible to load an AR object (.usdz for example from web url and place it in the AR view). I tried with this: let fileUrl = NSURL(string:…
Martin Kostadinov
  • 179
  • 1
  • 1
  • 8
5
votes
2 answers

RealityKit – Create line between two points in 3d space

How to create a line between two points in 3d space with RealityKit? There are examples of creating lines between two points in Scenekit, however, there are basically none using RealityKit. To create the line, I've created a rectangle model entity…
NeedHelp101
  • 599
  • 1
  • 9
  • 25
5
votes
1 answer

SceneKit LiDAR features for object occlusion

Object occlusion with LiDAR works in RealityKit with the scene understanding option. Basically the scanned geometry is used for the occlusion. arView.environment.sceneUnderstanding.options.insert(.occlusion) Sadly this is not included in SceneKit.…
Peter Pohlmann
  • 1,478
  • 15
  • 30
5
votes
1 answer

Remove Entity from Scene in RealityKit

I want to remove an Entity from my Scene. I created my Entity inside of the UpdateUIView function like this: // create anchor and model-Entity let anchor = AnchorEntity(plane: .horizontal) let cube = MeshResource.generateBox(size: 0.1,…
User_404
  • 91
  • 5
5
votes
1 answer

Track camera position with RealityKit

How can you track the position of the camera using RealityKit? Several examples are using SceneKit, but I found none using RealityKit. I need a function such as: func session(_ session: ARSession, didUpdate frame: ARFrame) { // Do something with…
Daniel Tovesson
  • 2,550
  • 1
  • 30
  • 41
5
votes
3 answers

How to add a Video Material to a ModelEntity?

I use the code to add a picture texture in RealityKit and it works fine. var material = SimpleMaterial() material.baseColor = try! .texture(.load(named: "image.jpg")) I try to use this code to add a video file to be a texture, but it…
nai xin
  • 51
  • 2
5
votes
1 answer

Challenges with RealityKit and ARKit

I want to build a demo app in ARKit and I have some questions about what is currently possible with the beta (Apple has been calling this RealityKit, or ARKit 3.0). The demo app I'm trying to build should do the following: identify an object or…
attl
  • 307
  • 1
  • 3
  • 8
5
votes
2 answers

SwiftUI: How to work with non-simulator supported frameworks and PreviewProvider?

I'm working on a RealityKit app, and using SwiftUI. Of course RealityKit view's does not work in the SwiftUI PreviewProvider preview. But my issue is that even simple and completely isolated SwiftUI views won't preview, since the PreviewProvider…
eivindml
  • 2,197
  • 7
  • 36
  • 68
5
votes
1 answer

How to Add Material to ModelEntity programatically in RealityKit?

The docs for RealityKit include the structs: OcclusionMaterial, SimpleMaterial, and UnlitMaterial for adding materials to a ModelEntity. Alternatively you can load in a model with a material attached to it. I want to add a custom material/texture to…
iicaptain
  • 1,065
  • 1
  • 13
  • 37
5
votes
1 answer

What is the real benefit of using Raycast in ARKit and RealityKit?

What is a raycasting in RealityKit and ARKit for? And when do I need to use a makeRaycastQuery instance method? func makeRaycastQuery(from point: CGPoint, allowing target: ARRaycastQuery.Target, alignment:…
Andy Jazz
  • 49,178
  • 17
  • 136
  • 220