瀏覽代碼

PDBLoader: Update Buffer Creation

Mugen87 8 年之前
父節點
當前提交
8ddeca5157
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      examples/js/loaders/PDBLoader.js

+ 3 - 3
examples/js/loaders/PDBLoader.js

@@ -175,10 +175,10 @@ THREE.PDBLoader.prototype = {
 
 		}
 
-		geometryAtoms.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( verticesAtoms ), 3 ) );
-		geometryAtoms.addAttribute( 'color', new THREE.BufferAttribute( new Float32Array( colors ), 3 ) );
+		geometryAtoms.addAttribute( 'position',  new THREE.Float32BufferAttribute( verticesAtoms, 3 ) );
+		geometryAtoms.addAttribute( 'color',  new THREE.Float32BufferAttribute( colors, 3 ) );
 
-		geometryBonds.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( verticesBonds ), 3 ) );
+		geometryBonds.addAttribute( 'position', new THREE.Float32BufferAttribute( verticesBonds, 3 ) );
 
 		callback( geometryAtoms, geometryBonds, json );