Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Viewer {
- // ... Other code snippets
- resize() {
- this.camera.aspect = window.innerWidth / window.innerHeight;
- this.camera.updateProjectionMatrix();
- this.renderer.setSize(window.innerWidth, window.innerHeight);
- }
- loadModel(url) {
- if (typeof url != 'string')
- throw new Error('Invalid model url');
- const objectLoader = new THREE.ObjectLoader();
- objectLoader.load(url, (obj) => {
- this.scene.add(obj);
- this.models.push(obj);
- this.render();
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement