I have created a render object in three.js and connect it with DomElment, shown as followed
var renderer = new THREE.WebGLRenderer({
antialias: true
});
renderer.setClearColor( 0xAAAAAA, 1 );
renderer.setSize(window.innerWidth, window.innerHeight);
document.getElementById('webgl-container').appendChild(renderer.domElement);
so now three.js automatically create a canvas inside the webgl-container div, but now I want to give a canvas a id, how could I do it
Have you tried :
renderer.domElement.id = 'YourIDName';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With