I have created a plane with width and height, and then I loaded a image as the texture to fit the plane. but it is not working correctly. could you give some advice. thanks
export function drawImage(texture, width, height) {
const linePath = [
MAP_POLYGON_VECTOR.clone().set(-width / 2, height / 2),
MAP_POLYGON_VECTOR.clone().set(width / 2, height / 2),
MAP_POLYGON_VECTOR.clone().set(width / 2, -height / 2),
MAP_POLYGON_VECTOR.clone().set(-width / 2, -height / 2),
MAP_POLYGON_VECTOR.clone().set(-width / 2, height / 2),
];
const material = new MeshBasicMaterial({
map: texture,
transparent: true,
});
const geometry = new ExtrudeGeometry(new Shape(linePath), {
steps: 5,
depth: 0.1,
bevelEnabled: false,
});
const mesh = new Mesh(geometry, material);
mesh.rotateX(Math.PI / 2);
mesh.position.y = 0.04 - width / 100;
return mesh;
}
the texture like below