Dynamic uv texture mapping

In Blender, within the UV Editing section, there is a standard square (often referred to as the UV space) that represents the 2D area onto which textures are mapped. This square ranges from coordinates (0, 0) in the bottom-left corner to (1, 1) in the top-right. When a texture is applied, the UV coordinates on the model tell Blender how to project the texture onto specific portions of the 3D model. It acts like a stencil, ensuring that different parts of the texture are applied to different parts of the model’s surface.

Similarly, in my Three.js project, I have a square canvas that I want to use as a texture for my model. However, I believe that the size or aspect ratio of my canvas doesn’t match the UV square used in Blender. This mismatch is causing my texture to be applied incorrectly or stretched. I need my canvas texture to dynamically correspond to the same UV space (0 to 1) that Blender uses, so the texture applies correctly across the model’s surface, similar to how it behaves in Blender’s UV Editor.

Can you show screenshot of what it is vs what it should be?

1 Like

UVs work the same in threejs as they do in blender.

However, textures in webGL/openGL are flipped vertically by default due to historical gl reasons.
You can change that behavior by setting .flipY = false on the texture immediately after loading it.

2 Likes

I don’t have the picture which might give you the complete context but thanks my issue has been solved.

1 Like

Yeah I realised it, thanks a lot for the help

1 Like