简体   繁体   中英

How to load 3d object on runtime in Unity 3D

I want to load 3d object on runtime. This 3d object(may be any ".fbx" file format like in Qualcomm Sample project ""ImageTarget" contain "teapot.fbx") load from any saved folder or in iphone from shared directory. If someone know please help me on that, this will be great help for me.

They question is do you really want to load a model from ANY folder.

If so, generally you would use WWW class to load stuff. Though as far as I know Unity won't automatically convert your .fbx file into a model if you load it with WWW . Unlike textures from images. You will have to parse it yourself. Which is easy in case of an .obj file but I don't know much about .fbx format.

I don't know if you can use C# File API in an Android app.

Other ways don't allow you to load model from ANY folder. These are:

  • Resources.Load which loads a file from Resources folder into memory. Resources folder is compiled in a big packed file in the final build.
  • Load files from StreamingAssets folder whose are not compiled in an assembly but left as is. Though as I see not in Android app .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM