Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. func loadEntitySync() {
  2. // Create an world anchor at the origin and add it to the scene
  3. let anchor = AnchorEntity(world: [0,0,0])
  4. arView.scene.addAnchor(anchor)
  5.  
  6. // Handle errors in case the file doesn't exist
  7. do {
  8. let usdzPath = "path/to/usdz/asset"
  9. let modelEntity = try ModelEntity.loadModel(named: usdzPath)
  10. anchor.addChild(modelEntity)
  11. } catch {
  12. print("file not found")
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement