I'm developing the VisionOS app. I want to know how to play spatial audio in addition to RealityKit? If it's iOS or macOS, how to play spatial audio in addition to RealityKit?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello, I'm adding a CollisionComponent to an entity in RealityView. CollisionComponent requires that a Mesh must be provided as a reference for collision detection. However, in order to achieve more accurate detection, I hope that this Mesh resource is a geometric shape of a USDZ model. Is there any way to make it happen? Thank you!
How to use transporter?
How to upload apps using transporter?
I used createML to generate a text-categorized mlmodel file. I want to import it into my app and let users use it. How can I pour in and write code?
Please note: 1. My app was written with SwiftUI. 2. This createML mlmodel file is used for text classification.
I'm writing a visionOS App using SwiftUI language, in which I wrote a button with the following code:
import SwiftUI
Button(action: {
openWindow(id: landmark.windowTag)
}) {
VStack {
Image(landmark.imageName)
.resizable()
.aspectRatio(contentMode: .fill)
.clipShape(RoundedRectangle(cornerRadius: 10))
.frame(width: 150, height: 150)
VStack(alignment: .leading){
Text(landmark.name)
.font(.title)
.foregroundColor(.white)
Text(landmark.describe)
.font(.subheadline)
.foregroundColor(.gray)
}
}
.frame(width: 200, height: 400)
.padding()
.clipShape(RoundedRectangle(cornerRadius: 20))
}
.padding(20)
My idea is that the border of the button is a rounded square (note that I'm not talking about the picture is a rounded square, but the border of the button is a rounded square), but the default button border of visionOS is oval, so I added the following code:
.clipShape(RoundedRectangle(cornerRadius: 20))
But there is no change in operation, and the border of the button has not become a rounded square. It is still the default oval of visionOS. How can I modify the code?
It has been more than a month since I applied for the Apple Vision Pro Developer Kit in July, and there is still no answer. I didn't get much from asking Apple Developer Support. Just tell me to let I'm waiting. I hope to get some information provided by everyone, thank you 🙏!
In Dev Kit Apply page:
We’ve received your application.
Thank you for your interest. We’ll get back to you soon with your status.
If you wish to withdraw your application, you may do so.
Does anyone have any latest news about the Apple Vision Pro Developer Kit?
Developer Kit Link
The default framework of visionOS is SwiftUI, but it can also be combined with UIKit in SwiftUI, and Apple has also released video documents and other content for this purpose. But what I want to know is that SwiftUI is much simpler than UIKit, but why does Apple recommend developers to combine with UIKit in SwiftUI? I also want to know what are the advantages of SwiftUI and UIKit in visionOS?
I hope you can reply to my two questions. Thank you!
May I ask how to find the credibility of the Apple Developer Program account?
Is TipKit compatible with visionOS?
In visionOS, in order to fully implement Group Activities, do we need to write additional code?
In visionOS, in ImmersiveSpace, how to let users drag a specific view?
In visionOS, have many code with 3D attributes (SwiftUI) is adapted from the code in iOS, like: .padding(_:) to .padding3D(_:). In iOS have .offset(x:_, y:_), it only have X and Y, but in visionOS, view is in a 3D scene, so I want offset have Z, but offset can't use Z, so I try offset3D:
import SwiftUI
//Some View
.offset3D(x: Number, y: Number, z: Number)
Xcode report an error:
Error: No member 'offset3D'
So do you now how to use like offset's Modifiers, and can use Z in visionOS.
I successfully changed a picture to the background in ImmersiveSpace in a full state with the following code.
import RealityKit
struct MainBackground: View {
var body: some View {
RealityView { content in
guard let resource = try? await TextureResource(named: "Image_Name") else {
fatalError("Error.")
}
var material = UnlitMaterial()
material.color = .init(texture: .init(resource))
let entity = Entity()
entity.components.set(ModelComponent(
mesh: .generateSphere(radius: 1000),
materials: [material]
))
entity.scale *= .init(x: -1, y: 1, z: 1)
content.add(entity)
}
}
}
However, when running, I found that when the user moves, the background is not fixed, but follows the user's movement, which I feel unrealistic. How to fix the background in the place where it first appears, and give the user a kind of movement that is really like walking in the real world, instead of letting the background follow the user.