Post

Replies

Boosts

Views

Activity

Model3D and Reality Composer Pro
I created a RealityKitContent in the Packages folder of the visionOS app project. At first, I tried to add a USDA model directly to its rkassets. I used Model3D(named: "ModelName", bundle: realityKitContentBundle) can The model is displayed normally, but then when I add a folder in rkassets and then put the USDA model in that folder, use Model3D(named: "ModelName", bundle: realityKit ContentBundle) cannot display the model normally. What should I do? If you know how to solve the above problems, please let me know and check if you know how to solve the following problems. If you know, please also tell me the answer. Thank you! The USDA model I mentioned in the question just now contains an animation, but when I used Model3D(named: "ModelName", bundle: realityKitContentBundle) , I found that the animation was not played by default, but needed additional code. Is there any documentation, video or listing code in this regard?
0
0
676
Dec ’23
Model3D with deep stretching
I used Model3D to display a model: Model3D(named: "Model", bundle: realityKitContentBundle) { phase in switch phase { case .empty: ProgressView() case .failure(let error): Text("Error \(error.localizedDescription)") case .success(let model): model.resizable() } } However, when I ran, I found that the width and length were not stretched, but when I looked at the depth from the side, they were seriously stretched. What should I do? Note: For some reason, I can't use the Frame modifier. Image: width and length error depth
0
0
486
Dec ’23
wwdc2023-10113 Video's manipulationState variable
Question 1: The manipulationState variable has been used many times in the 3D gestures part of wwdc2023-10113 Video. What do I need to use Expected Type for this variable? I tried to use the following code: @State private var manipulationState: GestureState Xcode error Reference to generic type 'GestureState' requires arguments in <... > Insert '<Any>' But I don't know what parameter to refer to in <Any> Question 2: If you have all the code snippets (or similar) of the 3D gestures part in this tutorial, please send it to me. Thank you.
0
0
374
Dec ’23
Spatial Audio
How does visionOS play an MP4 audio to Spatial Audio through SwiftUI or RealityKit? Note: Since I can only test the App through Simulator, in order to ensure that my Spatial Audio is played correctly in the space, please tell me how to display the location of Spatial Audio in the space. Ew and how to delete this View after the test, thank you!
0
0
622
Dec ’23
Play Spatial Audio
I want to play RealityKitContent USDA model's Spatial Audio, I use this code: RealityView{ content in do { let entity = try await Entity(named: "isWateringBasin", in: RealityKitContent.realityKitContentBundle) let audio = entity.spatialAudio entity.playAudio(audio) content.add(entity) } catch { print("Entity encountered an error while loading the model.") return } } entity.playAudio(audio) this code need add a 'AudioResource' back of audio, Excuse me, what should AudioResource be?
0
0
543
Dec ’23
Anchor the whole object
We can use AnchorEmpty to fix RealityView in one place, such as a wall. Now I hope that it can not only be fixed in one place, but also fill the whole place with RealityView by stretching. For example: My RealityView is a picture, which is now anchored to the wall, and ARKit will stretch the picture according to the size of the wall. How to achieve the whole wall? Thank you!
0
0
569
Feb ’24