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