Dynamic .glb load

Unity 2022.3.0f1

I want to load the .glb file dynamically, but adding the CesiumGlobeAnchor to the GameObject breaks the loaded model.
Gltf model loader library uses glTFast for Unity.
If you do not add CesiumGlobalAnchor, the model will not break.

Since the whole code is not posted, it is the code of the relevant part.

var geoReference = FindObjectOfType<CesiumGeoreference>();
var t = mediaInfo.transform;
var go = new GameObject();
go.transform.parent = geoReference.transform;
geoReference.Initialize();
var childGO = new GameObject();
childGO.transform.parent = go.transform;
var gltf = childGO.AddComponent<GLTFast.GltfAsset>();
await gltf.Load($"{baseURL}/download/{System.Uri.EscapeDataString(mediaInfo.fileId)}");
var anchor = go.AddComponent<CesiumGlobeAnchor>();
anchor.longitudeLatitudeHeight = new double3(t.longitude, t.latitude, t.altitude);

It’s my mistake.
The value set for anchor.longitudeLatitudeHeight was Radians. Degrees worked fine.

@gtk2k Good job, i am following this case. And are you sure that glTFast for Unity is suitable for dynamic glb load ? Is there any problem?

I mostly use it only for loading models, but I haven’t had any problems so far.
It also supports loading animations.
(A minor issue is the orientation of the model loaded with glTFast.)
What are you worried about?

@gtk2k My problem facing now is that the path on the android system is not completely same with windows when loading glb dynamically, android mostly unsupport streamingassets, means loading glb danamically is error. Do you have the same problem?

I don’t have any experience with Android, so I can’t give you an accurate answer, but several sites have introduced that on Android, the path to the StreamingAssets folder is in URL format, and UnityWebRequest is used to load it.
Therefore, I think that you can probably load the model with the code below.
var gltf = gameObject.AddComponent<GLTFast.GltfAsset>();
gltf.Url = $“{Application.streamingAssetsPath}/{fileName}”;

@gtk2k OK. I want to make sure one thing for farther:How do you use glTFast, Combine with CesiumForUnity or indepentently?
CesiumForUnity load Tileset is feasible based on my acknowledge, Combine with CesiumForUnity is needless in some degree.

If you look at the code in my first post, you’ll see how I use it, but the main way to use it is to use glTFast to load a model into a GameObject whose position is specified using CesiumGlobeAnchor.