Hi,
I have canvas with a specific shape which the user can draw inside (the shape must not be changed), and I have a three.js mesh that I project this canvas on it with Decal.
The mesh shape is almost like the canvas shape, but I need to stretch the decal a little to fit the mesh shape, how can I do it (stretching by the canvas corners will do the job I think)? scaling and resizing do not help.
something like:
const textureRef = useRef(new THREE.CanvasTexture(fabricCanvas.getElement()));
return (
<mesh geometry={nodes.mesh_49_1.geometry} material={materials.PTRCZRV2FEXXY2ZF_MAT_MR} ref={meshRef}>
<Decal
debug
position={pos} // Position of the decal
rotation={rotation} // Rotation of the decal (can be a vector or a degree in radians)
scale={scale} // Scale of the decal>
<meshStandardMaterial map={textureRef.current} toneMapped={false} transparent polygonOffset polygonOffsetFactor={-1}/>
</Decal>
</mesh>)