Load an Image to scene from blob url

How can I load an Image to the scene from a blob url and control it’s positioning and size. I am thinking about using several instances of this same image in different places on the scene.

You mean as a texture? can you be more precise?

well i am not going to apply it as a texture on a mesh… it’s just like an image of a tree to be used to create a forest but from a blob url… i have seen examples using sprite manager but not with blob url…

A blob url is no different than a regular url when passing to functions. What object are you trying to create? What examples are you referring to?

A blob url doesn’t work when I try and do something like this

const spriteManagerProduct = new BABYLON.SpriteManager(
            'spriteManagerProduct',
            blobUrl,
            1,
            { width: size.width, height: size.height },
            this._scene
        )

        const product = new BABYLON.Sprite(instanceID, spriteManagerProduct)

Can you be more specific when you say “a blob url doesn’t work”? Are you getting an error in the console log? The best way for us to help you is you can reproduce the problem in the Babylon.js playground.

let me try to reproduce it at the playground. I don’t get an error in the logs though…

@bghgary here is the playground https://playground.babylonjs.com/#NU4F6Y#258

Well you had several non related issue so I figured out it would be faster to create a new one:
https://www.babylonjs-playground.com/#KLR6WC#1

In your PG, you had InstanceID not defined and no camera

3 Likes

Thanks @Deltakosh works now…