Hello; i have scene with streching plane that has texture,
here is resize function
resize() {
this.width = this.container.offsetWidth;
this.height = this.container.offsetHeight;
this.renderer.setSize(this.width, this.height);
this.camera.aspect = this.width / this.height;
// image cover
this.imageAspect = this.slides[0].image.height / this.slides[0].image.width;
let a1;
let a2;
const dist = this.camera.position.z;
const height = 1;
this.camera.fov = 2 * (180 / Math.PI) * Math.atan(height / (2 * dist));
if (this.height / this.width > this.imageAspect) {
// this.plane.scale.y = this.camera.aspect;
this.plane.scale.x = this.plane.scale.y / this.imageAspect;
} else {
this.plane.scale.x = this.camera.aspect;
this.plane.scale.y = this.plane.scale.x * this.imageAspect;
}
this.camera.updateProjectionMatrix();
}
sometimes when i refresh seem like uv coordinates break
here are images
this happens when i refresh sometimes