Texture is being placed rotated on mesh

I dont know why my texture is being placed rotated on child mesh of object (iphone screen)

repo: GitHub - tupynambalucas/Iphone-Product-Web3D
github page: Iphone (for those who wiling to acess the github page, mouse scroll is needed on this UX)

texture code:

                let texture = textureLoader.load(source);
                // texture.rotation = Math.PI;
                // texture.center.set( 0.5, 0.5 );
                texture.wrapT = THREE.RepeatWrapping;
                texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
                texture.flipY = false;
                texture.repeat.set( 1, 1 );
                let material = new THREE.MeshBasicMaterial({ 
                    map: texture,
                    shininess: 200,
                    // reflectivity: 1,
                    specular: 0xFFFFFF,
                    fog: false
                });
                o.material = material

texture.rotation = Math.PI * .5 ?

I’ll try, but I don’t want a solution that is a patch, I want it to be placed correctly by default.

then you have to rotate the UV coordinates on the screen geometry.

You’ll probably have to use repeat/offset anyway to correct for the aspect ratio of whatever image you’re going to map on there.

I’ll take a look at the UV in blender I made some changes to it recently, before adding these sections, maybe I made an inappropriate change. Thanks for now.

You were right, I looked for the problem in the wrong place, I had edited the UV previously and two edges were misaligned and I didn’t even think to check the UV again, I’m so dumb


1 Like

Nice! :smiley: Glad you figured it out!

Thank you so much. If it weren’t for you, I’d still be banging my head trying to look for a problem where there isn’t one. It was just something so basic, so basic that I didn’t even think to check it.

1 Like

It gets easier! :smiley:

1 Like