MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / onWindowResize

Function onWindowResize

assets/js/3DCube.js:67–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65}
66
67function onWindowResize() {
68 // Camera frustum aspect ratio
69 camera.aspect = window.innerWidth / window.innerHeight;
70 // After making changes to aspect
71 camera.updateProjectionMatrix();
72 // Reset size
73 renderer.setSize(window.innerWidth, window.innerHeight);
74}
75
76window.addEventListener("resize", onWindowResize, false);
77

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected