shx-3d-render
parent
6ef0136ab6
commit
d8c928a87f
|
@ -117,7 +117,12 @@
|
|||
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
|
||||
|
||||
const renderer = new THREE.WebGLRenderer();
|
||||
renderer.setSize(window.innerWidth, window.innerHeight);
|
||||
|
||||
// calc width and height
|
||||
const width = container.offsetWidth;
|
||||
const height = width;
|
||||
|
||||
renderer.setSize(width, height);
|
||||
renderer.setAnimationLoop(animate);
|
||||
container.appendChild(renderer.domElement);
|
||||
|
||||
|
|
Loading…
Reference in New Issue