Now that we have the Vision Pro, I really want to start using Apple's Object Capture API to transform real objects into 3D assets. I watched the latest Object Capture vid from WWDC 23 and noticed they were using a "sample app".
Does Apple provide this sample app to VisionOS developers or do we have to build our own iOS app?
Thanks and cheers!
Post
Replies
Boosts
Views
Activity
Planning to use 3D video in "windows" and "volumes" in my visionOS app, what's the easiest method to capture 3D video for this need?
Thanks and cheers!
Very excited about the potential of using 3D video within a volume for VisionOS. For example, I want to offer experiences where users can see a video playing in a volume and have the ability to walk around it. My question is, how would you capture 3D video that would play in this volume?
Thanks
Running on iOS17 Beta 6 and getting the below issue.
Conformance of 'ObjectCaptureSession.CaptureState' to protocol 'Equatable' was already stated in the type's module '_RealityKit_SwiftUI'
Operator function '==' will not be used to satisfy the conformance to 'Equatable'
'ObjectCaptureSession.CaptureState' declares conformance to protocol 'Equatable' here
Please help!
What type of media is being used in the full immersion scenes Apple is showing as examples? Are they 360 photos?
I've setup a NavigationLink so users can tap on the image and they're taken to another view, in this case "FenderExperience". I can't for the life of me figure out how to make this oval bar behind the image disappear. Is this an Xcode preview issue? I'm running Xcode 15.2
struct BrandImage: View {
var body: some View {
VStack(alignment: .leading) {
NavigationStack {
Text("Ralph Lauren")
.font(.title)
.padding(.bottom, -5)
Image("RL")
.resizable()
.scaledToFit()
.frame(width: 300, height: 200)
.overlay(
RoundedRectangle(cornerRadius: 0)
.stroke(Color.white, lineWidth: 2))
Text("Fender")
.font(.title)
.padding(.bottom, -5)
NavigationLink(destination: FenderXperience()) {
Image("Fender II")
.resizable()
.scaledToFit()
.frame(width: 300, height: 95)
.overlay(
RoundedRectangle(cornerRadius: 0)
.stroke(Color.white, lineWidth: 2))
}
Text("Burton")
.font(.title)
.padding(.bottom, -5)
Image("Burton")
.resizable()
.scaledToFit()
.frame(width: 300, height: 200)
.overlay(
RoundedRectangle(cornerRadius: 0)
.stroke(Color.white, lineWidth: 2))
Text("Ray Ban")
.font(.title)
.padding(.bottom, -5)
Image("Ray Ban")
.resizable()
.scaledToFit()
.frame(width: 300, height: 200)
.overlay(
RoundedRectangle(cornerRadius: 0)
.stroke(Color.white, lineWidth: 2))
Text("Levi's")
.font(.title)
.padding(.bottom, -5)
Image("Levis II")
.resizable()
.scaledToFit()
.frame(width: 300, height: 200)
.overlay(
RoundedRectangle(cornerRadius: 0)
.stroke(Color.white, lineWidth: 2))
}
}
.padding(.leading, 50)
}
}
#Preview {
BrandImage()
}
I'm trying to use Model3D in a similar fashion to how I've used Image in the below data structure for my visionOS app and I keep getting the following error message.
Reference to generic type 'Model3D' requires arguments in <...>
Here is my data structure code.
import Foundation
import SwiftUI
import RealityKit
struct BrandEcommData: Hashable, Codable, Identifiable {
var id: Int
var brand: String
var name: String
var category: String
var itemDetail: String
var price: String
var itemDescription: String
var imageName: String
var ThreeDitem: String
var image: Image {
Image(imageName)
}
var volume: Model3D {
Model3D(ThreeDitem)
}
}
Anyone else having issues in Xcode preview where when you tap on a button to open a volume window nothing appears in the Xcode preview window?
For example, if you download the Hello World Xcode project and try to open the globe volume after tapping the toggle button, the globe volume window never opens.
Running the latest version of Xcode 15.3 beta.
Anyone else having issues where you can see your 3D models in Xcode preview but when running simulator all you see is the progress view spinner? Below is my Model3D load that I can see in preview but in simulator it only shows the spinner. Any suggestions?
import RealityKit
struct Three_D_Ad: View {
var body: some View {
VStack {
Image("Fender")
Text("Fender Stratocaster")
.font(.title)
Text("Legendary Sound")
Model3D(named: "Fender") { model in
model
.resizable()
.scaledToFit()
.scaleEffect(0.75)
} placeholder: {
ProgressView()
}
}
}
}
#Preview {
Three_D_Ad()
}
Building in visionOS and one of my Swift UI views keeps causing Xcode to crash. The root issue is within the preview code, stuck on updating the preview code to prevent Xcode from crashing. When I run the simulator the app works perfectly, no bugs or issues. Any advice on how to update the preview code would be very helpful :)
import RealityKit
import RealityKitContent
struct BrandImage: View {
@State private var currentIndex: Int = 0
@Environment(\.openWindow) private var openWindow
@EnvironmentObject var sharedAppState: SharedAppState
var brand: [BrandEcommData]
var initialBrand: BrandEcommData
init(brand: [BrandEcommData], initialBrand: BrandEcommData) {
self.brand = brand
self.initialBrand = initialBrand
if let initialIndex = brand.firstIndex(where: { $0.id == initialBrand.id}) {
_currentIndex = State(initialValue: initialIndex)
}
}
var body: some View {
HStack(spacing: 0) {
ZStack {
ForEach(0..<brand.count, id: \.self) { index in
if index == currentIndex {
VStack {
Text(brand[index].brand)
.padding(.top, 5)
brand[index].image
.resizable()
.scaledToFit()
}
.transition(.scale)
}
}
HStack {
Button(action: {
withAnimation {
self.currentIndex = (self.currentIndex - 1 + brand.count) % brand.count
sharedAppState.currentModelId = brand[currentIndex].id
}
}) {
Image(systemName: "arrow.left.circle.fill")
.font(.largeTitle)
.foregroundStyle(.linearGradient(
colors: [.black, .gray],
startPoint: .top,
endPoint: .bottom))
}
.padding(.leading, 20)
Spacer()
Button(action: {
withAnimation {
self.currentIndex = (self.currentIndex + 1) % brand.count
sharedAppState.currentModelId = brand[currentIndex].id
}
}) {
Image(systemName: "arrow.right.circle.fill")
.font(.largeTitle)
.foregroundStyle(.linearGradient(
colors: [.black, .gray],
startPoint: .top,
endPoint: .bottom))
}
.padding(.trailing, 20)
}
VStack {
HStack {
Spacer()
Button(action: {
openWindow(id: "volumetric")
})
{
Image(systemName: "cube.transparent")
.font(.title)
.padding()
.foregroundStyle(.linearGradient(
colors: [.black, .gray],
startPoint: .top,
endPoint: .bottom))
}
}
Spacer()
}
}
.frame(maxWidth: .infinity)
Rectangle()
.frame(width: 2)
.foregroundStyle(.linearGradient(
colors: [.black, .gray],
startPoint: .top,
endPoint: .bottom))
VStack {
Text(brand[currentIndex].name)
.font(.title2)
Text(brand[currentIndex].itemDetail)
.font(.subheadline)
Text(brand[currentIndex].itemDescription)
.padding()
Text(brand[currentIndex].price)
}
}
.onAppear {
sharedAppState.currentModelId = initialBrand.id
}
}
}
#Preview {
if let initialBrand = ecommdata?.first {
BrandImage(brand: ecommdata!, initialBrand: initialBrand)
} else {
Text("Unable to load 3D Asset")
}
}
Anyone out there incorporate UE5 assets into their app yet? Epic will be offering support for the full immersion style, which is so rad.
I need to offer Apple Pay within my visionOS app for ecomm transactions, does this functionality exist yet for Apple Vision Pro apps? Below is the current documentation and I do not see visionOS :/ Just want to confirm.
Apple Pay Developer Doc
Thanks!
Integrating Apple Pay for a Shopify Store via headless ecomm. Shopify on the backend/iOS + visionOS app on the front end. Shopify won't admit that they're at the wrong here BUT they are. The available CSR file from Shopify that you download is not using the encryption method Apple accepts, therefore you have to work some OpenSSL magic on your Mac terminal to create the correct encryption Apple Developer requires. Open Chat GPT 4.0 or later and type in the below, your issue is solved on that front.
"I'm trying to upload a certificate signing request file to create a merchant identity certificate for Apple Pay. I'm getting the following error message from Apple, "CSR algorithm/size incorrect. Expected: RSA(2048)". What does this mean and how do I fix the CSR file? I've uploaded the CSR file for reference."
My issue now is that Shopify gives me an error when attempting to upload the Merchant ID certificate from Apple Developer. Simply stating, "An error occurred while trying to save the certificate."
Anyone else get this far and run into this issue? Thanks
Within Xcode when initializing the client via code below, do I insert this code in my app declaration Swift file or can it be just another Swift file included in my app? Thanks!
let client = Graph.Client(
shopDomain: "your-shop-name.myshopify.com",
apiKey: "your-storefront-access-token",
locale: Locale(identifier: "en_US")
)
Anyone else getting the below issue when using Shopify's SDK for iOS? Seems odd they just released a new version and it already has an issue embedded in the package.