This file contains hidden or 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
// Approach 1 (links) | |
// Once the renderer finds a *MeshFaceMaterial*, it'll process the face material array | |
var common_material = [ new BitmapUVMaterial( bitmap ) ]; | |
mesh.material = [ new MeshFaceMaterial(), new MeshColorStrokeMaterial( 0xff0000 ) ]; | |
mesh.faces[ 0 ].material = common_material; | |
mesh.faces[ 1 ].material = common_material; | |
// Approach 2 (indices) |
This file contains hidden or 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
var start = new Date(); | |
var data = eval('(' + | |
"[[\"1.\",\"2107773\",\"\\\"http:\\/\\/www.crunchgear.com\\/2011\\/01\\/15\\/a-brief-explanation-of-why-minecraft-matters\\/\\\"\",\"Why Minecraft Matters\",\" (crunchgear.com) \",\"50\",\"solipsist\",\" 2 hours ago | \",\"17 comments\"],[\"2.\",\"2108021\",\"\\\"http:\\/\\/antimatter15.com\\/wp\\/2011\\/01\\/the-ambiguity-of-open-and-vp8-vs-h-264\\/\\\"\",\"The Ambiguity of Open and H.264 vs. VP8\",\" (antimatter15.com) \",\"17\",\"antimatter15\",\" 1 hour ago | \",\"discuss\"],[\"3.\",\"2107618\",\"\\\"http:\\/\\/www.jamesmolloy.co.uk\\/tutorial_html\\/index.html\\\"\",\"Roll your own toy UNIX-clone OS\",\" (jamesmolloy.co.uk) \",\"57\",\"Rusky\",\" 4 hours ago | \",\"1 comment\"],[\"4.\",\"2108034\",\"\\\"http:\\/\\/nealpoole.com\\/blog\\/2011\\/01\\/http-response-splitting-on-reddit-com\\/\\\"\",\"HTTP Response Splitting Vulnerability on reddit.com\",\" (nealpoole.com) \",\"7\",\"there\",\" 1 hour ago | \",\"3 comments\"],[\"5.\",\"2107755\",\"\\\"http:\\/\ |
This file contains hidden or 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) { |
This file contains hidden or 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
/** | |
* @author mr.doob / http://mrdoob.com/ | |
* @author philogb / http://blog.thejit.org/ | |
* @author zz85 / http://www.lab4games.net/zz85/blog | |
*/ | |
THREE.Vector2 = function ( x, y ) { | |
this.set( |
This file contains hidden or 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
/** | |
* @author zz85 / http://www.lab4games.net/zz85/blog | |
* Creates free form path. | |
**/ | |
THREE.Path = function (path) { | |
this.path = path || []; | |
}; | |
var ACTIONS = { |
This file contains hidden or 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
/** | |
* @author zz85 / http://www.lab4games.net/zz85/blog | |
* Creates free form path. | |
**/ | |
THREE.Path = function (points) { | |
this.path = []; | |
if (points) { | |
this.fromPoints(points); | |
} |
This file contains hidden or 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
/** | |
* @author alteredq / http://alteredqualia.com/ | |
* | |
* ShaderExtras currently contains: | |
* | |
* screen | |
* convolution | |
* film | |
* bokeh | |
* sepia |
This file contains hidden or 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
var perlin = new SimplexNoise(); | |
var Turbulence = function() { | |
this.frequency = 1; | |
this.octaves = 1; | |
this.amplitude = 1000; | |
this.evolution = 0; | |
Turbulence._turbulenceVel = new THREE.Vector3(); | |
}; |
This file contains hidden or 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
// https://github.com/zz85/ | |
// implements Point - in - Polygon | |
// described in "A Winding Number and Point-in-Polygon Algorithm" | |
// returns 0 if point is not in polygon | |
// returns n > 0 if contour winds around point in counter-clockwise manner n times | |
// returns n < 0 if contour winds around point in clockwise manner -n times | |
function pointInPolygon(point, contour) { | |
// Creates a copy of contour | |
var adjustedContour = []; | |
var i,il; |
This file contains hidden or 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.CombinedCamera = function ( width, height, fov, near, far, orthonear, orthofar ) { | |
THREE.Camera.call( this ); | |
this.cameraO = new THREE.OrthographicCamera( width / - 2, width / 2, height / 2, height / - 2, orthonear, orthofar ); | |
this.cameraP = new THREE.PerspectiveCamera( fov, width/height, near, far ); | |
this.toPerspective(); | |
}; |
OlderNewer