Skip to content

Instantly share code, notes, and snippets.

@peyloride
Created March 8, 2019 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peyloride/ddbd48e512f9a4292880b99c69988d91 to your computer and use it in GitHub Desktop.
Save peyloride/ddbd48e512f9a4292880b99c69988d91 to your computer and use it in GitHub Desktop.
// 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