But this piece of your code will never work obviously:
position: new BABYLON.Vector3(12,12,12) When dealing with decals this must be a world position of the decal, so even with the correct syntax it doesn’t make sense to put it to 12,12,12.
The width and the height of the dynamic texture has nothing to do with the position of the image on the texture. You need to use x and y of the drawImage method.
var textureContext = textureShirt.getContext();
textureContext.drawImage(img, x, y);
An important thing to remember is that the canvas’ coordinate system, which is used by drawImage, starts from the top left corner of the texture at (0,0) and increases to the right and down, like this:
As another possible implementation. If we’re using a dynamic texture why not upgrade it to a advance dynamic texture. (Always love to throw in the Babylon GUI and GUI Editor plug).
Granted I don’t think this is perfect because now you have to deal with the UV wrapping. However, currently in development is a workflow that will allow you to open your GUI texture from the inspector into the editor and see changes in real time. I can definitely see this useful when trying to align your texture with the UV wrapping. Plus with the editor you will be able to layer dozens of images/designs on top of each other to get it how you would like. Stay tuned.