GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — old/Viewport.js at master · vfasteng/old Expand file tree/ Copy pathViewport.jsMore file actions 43 lines (30 loc) · 941 Bytes / Copy pathViewport.jsFile metadata and controls43 lines (30 loc) · 941 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 import * as THREE from 'three' export default class Viewport { constructor (canvas, scene) { this.width = null this.height = null this.aspectRatio = null this.canvas = canvas this.renderer = new THREE.WebGLRenderer({ canvas }) this.renderer.setPixelRatio(window.devicePixelRatio); this.scene = scene this.camera = new THREE.PerspectiveCamera(50, 1, 1, 2000); this.camera.position.set(4, 8, 10); this.resize() } resize () { this.canvas.style.width = '' this.canvas.style.height = '' this.width = this.canvas.offsetWidth this.height = this.canvas.offsetHeight this.renderer.setSize(this.width, this.height) this.aspectRatio = this.width / this.height this.camera.aspect = this.aspectRatio this.camera.updateProjectionMatrix() this.render() } render () { this.renderer.render(this.scene, this.camera) return this.renderer.info; } } |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |