BufferGeometryManipulator.js 561 B

12345678910111213141516171819202122
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. THREE.BufferGeometryManipulator = function ( bufferGeometry ) {
  5. this.vertices = [];
  6. this.normals = [];
  7. this.uvs = [];
  8. var attributes = bufferGeometry.attributes;
  9. var length = attributes.position.array.length;
  10. for ( var i = 0, l = length / 3; i < l; i ++ ) {
  11. this.vertices.push( new THREE.TypedVector3( attributes.position.array, i * 3 ) );
  12. this.normals.push( new THREE.TypedVector3( attributes.normal.array, i * 3 ) );
  13. this.uvs.push( new THREE.TypedVector2( attributes.uv.array, i * 2 ) );
  14. }
  15. };
粤ICP备19079148号