Is there any way to initialize the uv edited texture?

Hi everyone :slight_smile:

I’d like to change the texture of the mesh (like a laptop/phone screen)

However, the uv of the mesh is edited (Downloaded or related to draw call issue)

In this case, how can I initialize uv with JS code?

When I upload the image to the texture, the UV setting should be initialized and the image should be applied to the mesh.

(The mesh shape that I want to change the texture can be any shape, not a plane, but first, I’d like to get an idea of a plane shape)

This is what I want below.

Here’s the playground link.
edited UV initializing test

Thanks in advance!


Heya, so I set/mapped the UVs to use the full texture (and also just rotated the UV’s directly instead of using wAng). I think that’s what you’re after? :slight_smile:

2 Likes

That’s exactly what I wanted!

BTW, if there’s a more complicated shape mesh like a curved monitor or something else,
how do I set the uv array?

Thanks for your help :grin:

Hmm, for the more complicated meshes it could be easier to map the UVs in a DCC tool with a UV editor. In theory you could do it in code too, but I like to stick to simple meshes for that… :slight_smile:

1 Like

Thanks for the advice.

I’ll give it a try!