How to convert render from three.js to .png file?
问题 How would I convert a render to a .png image? I've been looking around for awhile but nothing has worked. 回答1: Here is a function I use and a fiddle that shows it working. function takeScreenshot() { // For screenshots to work with WebGL renderer, preserveDrawingBuffer should be set to true. // open in new window like this var w = window.open('', ''); w.document.title = "Screenshot"; //w.document.body.style.backgroundColor = "red"; var img = new Image(); img.src = renderer.domElement