#screenshot of the model in r3f in react.

8 messages · Page 1 of 1 (latest)

tight sail
#

Hello need to take a screenshot of the model as soon as it loads on the screen with r3f?

mellow python
#

you can use libraries such as html2canvas

tight sail
#

Is there something inside threejs ?? r3f?

mellow python
#

not to my knowledge

obtuse hare
tight sail
#

@obtuse hare ?? How

obtuse hare
#

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.