应用程序由界面(html)和工作区(canvas)组成。 我们使用 Three.js 在 Canvas 上生成元素。 在 chrome、opera 和 firefox 35 上运行良好。 http://clip2net.com/s/3e7OwfF
但是在 Firefox 36.0.1 中 Canvas 是空的(参见 http://clip2net.com/s/3e7QkdH )。 3d 元素上的所有事件都正常工作。我看到渲染已完成。
如果我在 Canvas 上打开上下文菜单并选择“将图像另存为...”,则正确保存图像(包含所有渲染的元素)。
当我调整浏览器窗口大小时, Canvas 就会显示。
你能帮忙吗?
最佳答案
我在我的应用中发现了问题。
我这样使用WebGLRenderer:
renderer = new THREE.WebGLRenderer( { antialias: true, preserveDrawingBuffer: true } );
当我以这种方式使用它时, Canvas 不会被清除:(但我认为你无法进行屏幕截图):
renderer = new THREE.WebGLRenderer( { antialias: true } );
希望这有帮助
关于javascript - Firefox 36 中 Canvas 为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29034194/