echo3D
🌐 Back to website💻 Go to console📺 Watch workshop💬 Discuss on Slack
  • Introduction
  • Quickstart
    • 🔑Register
    • 💻Access the Console
    • 🎲Add a 3D Asset
    • 📤Share it with Others
    • ❔Troubleshooting
  • Web Console
    • 📦Load a Collection
    • 💼Manage Pages
      • Content Page
        • Assets and Targets
        • Add Content
        • Edit Content
        • Share Content
        • Access Permissions
        • Version Control
        • Asset Hierarchy
        • Bulk Actions on Assets
        • Asset Commenting
        • Activity Sidebar
      • Metadata & Tags Page
        • Collection Taxonomy and Asset Specific Metadata
        • How to Add and Edit Metadata
        • How to Add Associated Files and Text
      • Collections and Sharing Page
        • Users Tab
        • Groups Tab
        • Collections
        • Collection Sharing Tab
        • Asset Sharing Tab
        • Security Tab
      • Customizer Page
      • Model Editor Page
      • Scene Editor Page
    • 🚚Deliver Pages
      • Locations Page
      • Users Page
      • Insights Page
    • 🕛Optimize Pages
      • Convert & Compress Page
    • 🎓Learn Pages
      • Tutorials Page
    • 👤Account Page
      • Profile Tab
      • Email & Password
      • Plans Tab
      • Credit Usage Tab
      • Notifications Tab
      • Delete Account Tab
    • ❓Help Menu
    • ⏬Downloads
    • 🎨Themes
    • 🔎Search
  • API
    • 🧩Objects
    • 🗨️Queries
    • 📊Data
      • 📑What Metadata is Stored
    • 🔼Upload
    • 🔽Download
    • ❌Delete
    • 🌳Entry Hierarchy
    • 🔄Convert
    • 🔃Compress
    • 📁Organize
    • ⏪Version
    • ⏬Locate
    • 🔎Search
    • 🖼️Search by Image or Model
    • Share Content
  • Unity
    • 🔨Installation
    • 🧰Using the SDK
    • 🔧Script Settings
    • 📐Transforming Content
    • 👩‍💻Edit Code
    • 🤳Adding AR Capabilities
    • ❔Troubleshooting
  • Unreal 4
    • 🔨Installation
    • 🧰Using the SDK
    • 🔧Demo Project
  • Web
    • 🔨Installation
    • 🧰Using the Package
  • Scene Viewer
    • 📲Deploy Experience
    • 📐Transforming Content
    • 🔢Embed into Website or App
    • 👩‍💻Add Code
    • ❔Troubleshooting
  • AR.js
    • 📲Deploy Experience
    • 📐Transforming Content
    • 🔢Embed into Website or App
    • ❔Troubleshooting
  • FaceAR
    • 📲Deploy Experience
    • 📐Transforming Content
    • 🔢Embed into Website or App
    • ❔Troubleshooting
  • React Native
    • 📩Fetching Data
    • 👩‍💻Edit Code
    • 🤳Adding AR/VR Capabilities
    • 📐Transforming Content
  • Swift
    • 🔨Installation
    • 🔢Displaying a Model Asset
    • 🤳Adding AR Capabilities
    • 🧰Using the SDK
  • Flutter
    • 🔨Installation
    • 👩‍💻Edit Code
    • 🤳Adding AR Capabilities
  • JavaScript
    • 🔨Installation
    • 🧰Using the SDK
    • 📩Fetching Data
    • 👩‍💻Edit Code
  • Python
    • 🔨Installation
    • 🧰Using the SDK
    • 🔧Demo Project
  • NVIDIA Omniverse
    • 🔨Installation
  • Adobe Substance 3D Painter
    • 🔨Installation
  • 🧰Using the Plugin
  • Blender
    • 🔨Installation
    • 🧰Using the Add-on
  • eCommerce Sites
    • 🛒Shopify
    • 🌐Wix
  • 3D Content
    • 🎨Content Creation
    • 💎Google Poly
    • 📦Objaverse
    • 💫3D Capture Apps
      • MagiScan
      • Qlone
      • ARitize360
      • SCANN3D
      • 3D Scanner
      • Didimo Xperience
      • Scaniverse
      • Metascan3D
      • Polycam3D
      • RealityScan
Powered by GitBook
On this page
  • Adding 3D content
  • Setting Up an Application
  • Example Setup:

Was this helpful?

  1. Swift

Displaying a Model Asset

Learn how to add non-AR asset to your project using our Swift SDK.

PreviousInstallationNextAdding AR Capabilities

Last updated 1 year ago

Was this helpful?

Now that you have successfully integrated the echo3D SDK into Xcode, it's time to display a model in your project!

is a rendering engine that allows you to develop native iOS and visioOS apps in Xcode.

Adding 3D content

Add a model asset through the console. Here's how:

Setting Up an Application

Construct an object of type Echo3D and use it to access Assets stored under your echo3D account's API Key.

Render your assets however you want.

Example Setup:

import SwiftUI
import SceneKit

struct ContentView: View { // Creates a SwiftUI View
    var body: some View { // Creates a SwiftUI body
        VStack {
            Text("View Your Echo3D Model!")
                .font(.headline)

            SceneKitView()
                .frame(width: 350, height: 350) // Adjust the size as needed
        }
    }
}

struct SceneKitView: UIViewRepresentable { // Creates the Scene with 3D Model using SceneKit and Echo3D Swift SDK
    
    func makeUIView(context: Context) -> SCNView { // Creates a simple scene
        let sceneView = SCNView()
        sceneView.autoenablesDefaultLighting = true
        sceneView.allowsCameraControl = true
        return sceneView
    }

    func updateUIView(_ sceneView: SCNView, context: Context) { // Adds 3D Model stored under your Echo3D Accounts API Key
        let e = Echo3D(); // Create an object of class Echo3D
        
        e.queryDatabase(api_key: e.api_key, completion: { (entry_list) -> () in // Queries Echo3D's database for 3d Models
            let entry = entry_list[0]
            entry.downloadFile(completion: { (storage_id) in // Downloads the specificed 3D model entry and loads it into the scene
                if let object = try? SCNScene(url: storage_id, options: nil) {
                    let objectNode = object.rootNode
                    sceneView.scene = object
                    sceneView.scene?.rootNode.addChildNode(objectNode)
                }
            });
        });
    }
}

@main
struct SDKTest2_6App: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

🔢
Scene Kit
Add Content