You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
468 B

4 years ago
4 years ago
4 years ago
  1. import * as THREE from 'three';
  2. var renderer = new THREE.WebGLRenderer();
  3. renderer.setSize( window.innerWidth, window.innerHeight );
  4. renderer.setClearColor(0xb9d3ff, 1); //设置背景颜色
  5. document.body.appendChild( renderer.domElement );
  6. var camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 1000 );
  7. camera.position.set( 0, 0, 100 );
  8. camera.lookAt( 0, 0, 0 );
  9. var scene = new THREE.Scene();
  10. renderer.render( scene, camera );