Created
May 22, 2011 02:16
-
-
Save zz85/985108 to your computer and use it in GitHub Desktop.
Letter Z
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
THREE.LetterZ = function () { | |
THREE.Geometry.call( this ); | |
var scope = this; | |
vertices = [{"x":90.3,"y":0},{"x":0,"y":0},{"x":0,"y":-14.85},{"x":63.599999999999994,"y":-94.35},{"x":3,"y":-94.35},{"x":3,"y":-110.55},{"x":87.3,"y":-110.55},{"x":87.3,"y":-95.25},{"x":24,"y":-16.349999999999998},{"x":90.3,"y":-16.349999999999998}]; | |
faces = [[9,0,1],[1,2,3],[3,4,5],[5,6,7],[8,9,1],[3,5,7],[7,8,1],[1,3,7]]; | |
for (var i in vertices) { | |
var vert = vertices[i]; | |
v(vert.x, vert.y, 0); | |
} | |
for (var i in faces) { | |
var face = faces[i]; | |
f3(face[0], face[1], face[2]); | |
} | |
// UVs to be added | |
this.computeCentroids(); | |
this.computeFaceNormals(); | |
// this.computeVertexNormals(); | |
function v( x, y, z ) { | |
scope.vertices.push( new THREE.Vertex( new THREE.Vector3( x, y, z ) ) ); | |
} | |
function f3( a, b, c) { | |
scope.faces.push( new THREE.Face3( a, b, c) ); | |
} | |
}; | |
THREE.LetterZ.prototype = new THREE.Geometry(); | |
THREE.LetterZ.prototype.constructor = THREE.LetterZ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment