Search Unity

Load unkown 3D objects at runtime

Discussion in 'Vuforia' started by sminjard, Oct 11, 2017.

  1. sminjard

    sminjard

    Joined:
    Sep 21, 2017
    Posts:
    4
    Hello
    I'm creating an AR app (Android and iOS) and I need to load objects at runtime to display on the target recognized. I don't have a predefined set of objects. The objects are associated to an image on an external server. They can be obj or fbx and potentially other type of 3D object in the future. I'm wondering how I can load them in the unity app. I thought of 2 solutions :

    - On solution would be to install unity on a server that would convert any new 3D object into an asset bundle for each supported platform. However I can't afford to rebuild all the asset bundles every time since there can be lots of objects for lots of images. Since all the objects are independent from each other, is it possible to build their asset bundles separately when they are associated with an image and download only the ones we need in the app ?

    - Another solution would be to create our own parser in the app to parse 3D objects. But that mean one parser for each type of 3D object and it seems very complex to implement, especially for proprietary format like fbx. So I'd rather not go that way.

    I'm a little lost with this issue, it's an important point for my app but I don't have the unity knowledge to understand what's doable and what's not. So thanks in advance for anyone helping me with this!
     
  2. whitebozo

    whitebozo

    Joined:
    Oct 27, 2014
    Posts:
    29
    Wow that is a crazy ask. I have worked with a team that did something similar, but not. Let me explain a bit.

    So what our application was, was a launcher. It would look at the users credentials to pull down bundles that contained scenes, objects, and materials for whatever applications they had in their library from a server and act like a patch. It would add the scenes as buttons to the launcher and when the user clicked a button it would load the scene. When new content was put on the server and the user had rights to it, it would patch their application so they would now have it. We took this route as it was on mobile. Our PC version of the same application was written natively and worked more like steam. Which was way easier.

    If I understand what your asking it would probably be kinda similar but just pulling down models in asset bundles. Which will be a little easier than what we did as I don’t think it will deal with near as much reflection. I’m not sure how many models you are talking about and how many image target you are going to have.

    So how are you going to build the bundles? I would suggest creating prefabs of an image target with an associated model as a child. Then Bundle that prefab. You can store all the prefabs in one folder and create a bundle script to bundle all prefabs in a folder separately. You can then pull down the proper bundles for each image you want to include in the application using user credentials or however you are going to determine what image targets are necessary for the application.

    This is gonna be a long and painful process to complete and I hope anything I said is helpful, I know I kinda repeated what you already said. I was the development lead on that project so I didn’t do near as much heavy lifting on the coding of that project so I wish I knew more to tell you. I would suggest actually contacting either Vuforia or Unity for suggestions on this one. We had a contact at unity that helped our guys when they were doing this type of thing.
     
  3. whitebozo

    whitebozo

    Joined:
    Oct 27, 2014
    Posts:
    29
    Sorry for the double post.
    If you are going to have the model and image associated externally I’m not sure how to build the asset bundles.... I was talking more like the image and model were already defined and associated within Unity. But if you could figure that part out downloading only the ones needed is very doable using something like credentials.