|
@ -1,8 +1,15 @@ |
|
|
const setSize = (container, camera, renderer) => { |
|
|
const setSize = (container, camera, renderer) => { |
|
|
camera.aspect = window.innerWidth / window.innerHeight; |
|
|
// These are great for full-screen, which adjusts to a window.
|
|
|
|
|
|
const height = window.innerHeight; |
|
|
|
|
|
const width = window.innerWidth - 50; |
|
|
|
|
|
// These are better for fitting in a container, which stays that size.
|
|
|
|
|
|
//const height = container.scrollHeight;
|
|
|
|
|
|
//const width = container.scrollWidth;
|
|
|
|
|
|
|
|
|
|
|
|
camera.aspect = width / height; |
|
|
camera.updateProjectionMatrix(); |
|
|
camera.updateProjectionMatrix(); |
|
|
|
|
|
|
|
|
renderer.setSize(window.innerWidth, window.innerHeight); |
|
|
renderer.setSize(width, height); |
|
|
renderer.setPixelRatio(window.devicePixelRatio); |
|
|
renderer.setPixelRatio(window.devicePixelRatio); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|