Apply a material to a position of an object

How can i apply a material to a position of an object?

I have a mug object an i like to apply the material to position, to create a mockup tool for a mug store.

When i apply the material the image is stretched to all object.

Example: https://app.rapidmockup.net/

Any tip?

You’ll need to prepare the object first, with UVs where you need the texture to be, and separating parts of the object where you want another material to be used. It’s best to do this in a modeling program like Blender, then export as glTF/GLB.