#screenshot of the model in r3f in react.
8 messages · Page 1 of 1 (latest)
you can use libraries such as html2canvas
Is there something inside threejs ?? r3f?
not to my knowledge
I can help you simply.
@obtuse hare ?? How
const {gl} = useThree();
const link = document.createElement('a')
link.setAttribute('download', 'look.png');
let screenshot = gl.domElement.toDataURL('image/png');
screenshot.replace('image/png', 'image/octet-stream');
link.setAttribute('href', screenshot)
link.click();
I hope this can help you.