Clear Canvas WebGL, Three.JS

I am working with WebGLRenderer in three.js file and I cannot clear the canvas. Basically, I have a method that adds another object to the scene, but clears up the children before adding them. For example,

group = new THREE.Object3D();

function add(object){
    group.children = [];//clears the group children first
    group.add(object);
}

      

I thought it would make it clear, but I was wrong. I'm used to canvasrendering doing this for me. Does anyone know how I need to clear the WebGL canvas?

+3
javascript opengl-es canvas three.js webgl


source to share


No one has answered this question yet

Check out similar questions:

889
How to clear the canvas for redrawing
874
Using HTML5 / Canvas / JavaScript to take screenshots in the browser
17
Clearing threejs web context contexts
2
Combining A-frame with Three.js
0
Get webgl texture from canvas
0
Three.js / WebGL and 2D Canvas - Passing getImageData () array to Three.DataTexture ()
0
Interacting with the WebGL scene from independent elements
0
Three.js canvas tone text when scaled
0
How to add vertex or point geometry in webgl scene using three.js?
-1
How to embed canvas with Mesh inside WebGL Render in Three JS



All Articles
Loading...
X
Show
Funny
Dev
Pics