dbkaplun/node-three-screenshot


Take a PNG screenshot of a THREE scene

  • Users starred: 11
  • Users forked: 2
  • Users watching: 11
  • Updated at: 2020-05-15 17:42:26

node-three-screenshot Build Status

Take a PNG screenshot of a THREE scene

Usage

You will need to install the dependencies for node-canvas.

$ npm install node-three-screenshot
import { toPNG } from 'node-three-screenshot';

fs.writeFileSync('out.png', toPNG(scene));

With Jest

$ npm install jest-image-snapshot
import { toPNG } from 'node-three-screenshot';
import { toMatchImageSnapshot } from 'jest-image-snapshot';

expect.extend({ toMatchImageSnapshot });

expect(toPNG(obj)).toMatchImageSnapshot();

screenshot