Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question How to load 3D model from remote database in runtime

Discussion in 'Addressables' started by coskuncengiz60, Jan 15, 2023.

  1. coskuncengiz60

    coskuncengiz60

    Joined:
    Aug 27, 2021
    Posts:
    2
    Hi,
    I'm thinking of developing a mobile application where we can do various interactions on 3D models (rotate the model, split it into parts, move the parts by dragging, video about the model). There will be more than one 3d model and the arrival of these models on the scene will be provided by a menu. There will be more than one main element in the menu and sub-menu elements under these elements. For example, the main menu items A, B, C. Submenu items A1, A2, A3 and B1, B2, B3, B4 and C1, C2. There will be a menu structure such as A1-Model1, A1-Model2, A2-Model1... Clicking on A2-Model1 will bring the relevant model to the scene.
    Now the main issue I have difficulty with;

    1. The main and child elements of the menu will be kept in a remote database.
    2. 3D models and all the parameters required for interaction of these models will also be in a remote database.
    3. At the time of running, all the elements of the menu will be displayed according to the content in the remote database, and when the relevant model is selected from the menu, this model will be downloaded from the remote database and displayed on the scene.
    4. Elements of the menu can be added and updated via a web admin interface.
    5. With this web admin interface, 3d models and parameters can be added and updated.

    I looked at XML, JSON, addressable assets, asset bundles. Is it necessary to store the models in the database as fbx or prefab? I need help on how to use these or what other techniques.
     
  2. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,519
    This is a broad question. What specific parts of it are you having trouble with?
    You said you'd looked into Asset Bundles, which are the "easy" way to do that part.

    Also look at Unity's WWW class (or its modern replacement, the name of which I don't remember), and something like LAMP for hosting a database with queries available by web requests.
     
  3. coskuncengiz60

    coskuncengiz60

    Joined:
    Aug 27, 2021
    Posts:
    2
    Thank you.
    As you said, it's a broad topic. I'm going to try to get this done piece by piece. First of all, I will try to save the fbx model with some scripts and parameters in a database using asset bundles and import it in the application in runtime. I hope I can do this.
     
  4. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,519
    I'd start from the other end. What data formats can you load? Then, can you load them via HTTP?

    Also, I would avoid FBX, because it's designed for editing, not runtime use. Unity can only import FBX via the Editor, which converts them to an internal format for use. Importing FBX at runtime will take a significant amount of effort.