feat: add responsive window resize
This commit is contained in:
parent
2c78c867d6
commit
369e802a61
@ -65,4 +65,10 @@ function animate() {
|
||||
renderer.render(scene, camera)
|
||||
}
|
||||
|
||||
animate()
|
||||
animate()
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
camera.aspect = window.innerWidth / window.innerHeight
|
||||
camera.updateProjectionMatrix()
|
||||
renderer.setSize(window.innerWidth, window.innerHeight)
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user