tilo tilo - 1 year ago 119
Javascript Question

Threejs remove previous rendered scene

I created a renderer scene in threejs. When I load a model for the second time, I want to remove the previous rendered scene from th canvas. Is there any possible solution in threejs???

Answer Source

You can clear the canvas using

[WebGLRenderer].context.clear(16640); // 16640 is (COLOR_BUFFER_BIT | DEPTH_BUFFER_BIT)
// Replace [WebGLRenderer] with your instance of the renderer
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download