Bird.js 611 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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.computeFaceNormals();
  17. function v( x, y, z ) {
  18. scope.vertices.push( new THREE.Vector3( x, y, z ) );
  19. }
  20. function f3( a, b, c ) {
  21. scope.faces.push( new THREE.Face3( a, b, c ) );
  22. }
  23. }
  24. Bird.prototype = Object.create( THREE.Geometry.prototype );
  25. Bird.prototype.constructor = Bird;