Created
March 8, 2019 08:32
-
-
Save peyloride/ddbd48e512f9a4292880b99c69988d91 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set the scene size. | |
const WIDTH = window.innerWidth; | |
const HEIGHT = window.innerHeight; | |
// Set some camera attributes. | |
const VIEW_ANGLE = 45; | |
const ASPECT = WIDTH / HEIGHT; | |
const NEAR = 0.1; | |
const FAR = 10000; | |
const camera = | |
new THREE.PerspectiveCamera( | |
VIEW_ANGLE, | |
ASPECT, | |
NEAR, | |
FAR | |
); | |
// Create a WebGL renderer, camera | |
// and a scene | |
const renderer = new THREE.WebGLRenderer({ antialias: true }); | |
const scene = new THREE.Scene(); | |
// Add the camera to the scene. | |
scene.add(camera); | |
// Start the renderer. | |
renderer.setSize(WIDTH, HEIGHT); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment