Spacetime-Meta / spacetime-sdk

The spacetime-sdk is a turnkey virtual environment package for building in the Spacetime Metaverse
https://www.spacetimemeta.io/metaverse/spawn-planet
MIT License
11 stars 2 forks source link

add window resize listener #50

Closed Liquid-Blocks closed 2 years ago

Liquid-Blocks commented 2 years ago

added the following part in StdEnv.init

// ============= setup resize listener ==========
window.addEventListener('resize', () => onWindowResize(this.camera, this.renderer), false);

function onWindowResize(camera, renderer) {
    camera.aspect = window.innerWidth / window.innerHeight;
    camera.updateProjectionMatrix();
    renderer.setSize(window.innerWidth, window.innerHeight);
}
netlify[bot] commented 2 years ago

Deploy Preview for stdkit-dev ready!

Name Link
Latest commit a86f5fb87edbf727423a9850a26559d3efd85656
Latest deploy log https://app.netlify.com/sites/stdkit-dev/deploys/627c661ec6fc940009479d92
Deploy Preview https://deploy-preview-50--stdkit-dev.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.