diff --git a/src/index.js b/src/index.js index db6f42d..06156d3 100644 --- a/src/index.js +++ b/src/index.js @@ -7,7 +7,7 @@ var scene = new THREE.Scene(); //创建模型和material var geometry = new THREE.BufferGeometry(); var vertices = new Float32Array([ - 0, 0, 100 + 0, 0, 0 ]); var posAttribute = new THREE.BufferAttribute(vertices, 3); //类型数组创建顶点颜色color数据 @@ -17,8 +17,6 @@ var posAttribute = new THREE.BufferAttribute(vertices, 3); var colorAttribute = new THREE.BufferAttribute(colors, 3); geometry.attributes.position = posAttribute; geometry.attributes.color = colorAttribute; - - var material = new THREE.PointsMaterial( { vertexColors: THREE.VertexColors, size: 10.0 //点对象像素尺寸 @@ -50,7 +48,7 @@ camera.lookAt(scene.position); //创建渲染器 var renderer = new THREE.WebGLRenderer(); renderer.setSize(window.innerWidth, window.innerHeight); -renderer.setClearColor(0xb9d3ff, 1); //设置背景颜色 +renderer.setClearColor("rgb(30, 30, 30)", 1); //设置背景颜色 document.body.appendChild(renderer.domElement); const controls = new OrbitControls(camera, renderer.domElement);