Hello!
How can I add 3D models to Cesium using Blob object?
I dynamically generate glTF models and get theirs Blob objects
Then I try ty add it as an entity:
const pos = new Cesium.Cartesian3(x, y, z);
const orient = Cesium.Transforms.headingPitchRollQuaternion(pos, new Cesium.HeadingPitchRoll(0, -90, 0))
const entity = {
position: pos,
orientation: orient,
model: {
uri: data /** my glTF model represented as Blob */
};
this.viewer.entities.add(entity);
But nothind is happening
I also tried to use ‘URL.createObjectURL(data).toString()’ instead ‘data’ but that didn’t help either
Thank you for your answer!
But it turned out that URL.createObjectURL(data) works as it should, my mistake was was elsewhere in the code
So, it should be like that: