Bird.js 636 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. var Bird = function () {
  2. var scope = this;
  3. THREE.Geometry.call( this );
  4. v( 5, 0, 0 );
  5. v( - 5, - 2, 1 );
  6. v( - 5, 0, 0 );
  7. v( - 5, - 2, - 1 );
  8. v( 0, 2, - 6 );
  9. v( 0, 2, 6 );
  10. v( 2, 0, 0 );
  11. v( - 3, 0, 0 );
  12. f3( 0, 2, 1 );
  13. // f3( 0, 3, 2 );
  14. f3( 4, 7, 6 );
  15. f3( 5, 6, 7 );
  16. this.computeCentroids();
  17. this.computeFaceNormals();
  18. function v( x, y, z ) {
  19. scope.vertices.push( new THREE.Vertex( new THREE.Vector3( x, y, z ) ) );
  20. }
  21. function f3( a, b, c ) {
  22. scope.faces.push( new THREE.Face3( a, b, c ) );
  23. }
  24. }
  25. Bird.prototype = new THREE.Geometry();
  26. Bird.prototype.constructor = Bird;