Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

162
Views
¿Cómo usar la imagen AnchorEntity de RealityKit en SwiftUI?

Quiero usar AnchorEntity de RealityKit inicializado con un destino de componente de anclaje de tipo Imagen. Esto es lo que estoy tratando de hacer:

 let anchorEntity = AnchorEntity(.image(group: "AR Resources", name: "imgAnchor"))

No he encontrado documentación sobre cómo usar esto.

¿Alguien sabe la forma correcta de hacerlo?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Puede usar AnchorEntity(.image(...)) en SwiftUI casi de la misma manera que lo usó en UIKit. Al principio, haga clic en Assets.xcassets en el panel Project Navigator y cree la carpeta AR Resources . Arrastra tu imagen allí. Configure su tamaño físico en Inspector. Luego copia/pega el código:

 struct ARViewContainer: UIViewRepresentable { func makeUIView(context: Context) -> ARView { let arView = ARView(frame: .zero) let entity = ModelEntity(mesh: .generateBox(size: 0.1)) let anchor = AnchorEntity(.image(group: "AR Resources", name: "image.png")) entity.setParent(anchor) arView.scene.anchors.append(anchor) return arView } func updateUIView(_ uiView: ARView, context: Context) { } }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!