Loading model from stream

Hi guys,

I'm wondering if it's possibile to load component, such as a static model or a sound or a texture, from a file or stream not in asset directory.
I'm working on a xamarin forms app and i need to visualize 3d object retrieved from an internet source.

Thanks!

Answers

  • I've found a solution (for Android):

    var javafile = Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDownloads);
    string localPath = Path.Combine(javafile.AbsolutePath, "Models");

    StaticModel _obj = baseNode.CreateComponent();
    _obj.Model = ResourceCache.GetModel(localPath + "/" + mModelToLoad.name + ".mdl");

Sign In or Register to comment.