Reputation: 2174
It seems that the canvas is simply inserted into the body, at the bottom of the flow. I was wondering which bit of code do I need to change to get it to insert into a specific div?
Upvotes: 3
Views: 2609
Reputation: 3456
You could create the canvas yourself and put it to your desired location. Then pass it to the renderer constructor like this: renderer = new THREE.WebGLRenderer({ canvas: myCanvasElem });
See the docs.
Upvotes: 3
Reputation: 1647
It is usually this line:
container = document.createElement( 'div' );
//later in that file
container.appendChild( renderer.domElement );
change the first line to:
container = document.getElementById( 'mycustomdiv' );
Upvotes: 4