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
float hash( float n ) | |
{ | |
return fract(sin(n)*43758.5453); | |
} | |
float noise( vec3 x ) | |
{ | |
// The noise function returns a value in the range -1.0f -> 1.0f | |
vec3 p = floor(x); |
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
var str = "# object mesh \n"; | |
g.toIndexed(); | |
var vs = g.getAttribute("position").array; | |
var ind = g.getIndex().array; | |
var precision = 6; | |
for( var i = 0 ; i < vs.length; i+=3 ){ |
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
#target illustrator | |
var document = app.activeDocument; | |
var maxLength = prompt ("maximum length of a path", 10, "destroy them with lasers!"); | |
for (i=0 ; i< document.pathItems.length; i++) | |
{ | |
var ipath = document.pathItems[i] | |
if( ipath.hidden == true )continue; | |
var l = 0; | |
for( var j = 0; j < ipath.pathPoints.length - 1; j++ ){ | |
var p0 = ipath.pathPoints[j].anchor; |
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
/** | |
* creates a noise on the specified 2d context's canvas | |
* @ctx a 2d context | |
* @rgba color code specifies which channels are affected (default = 0 ) | |
* @min noise lower bound ( >= 0 ) | |
* @max noise upper bound ( <= 0xFF ) | |
* */ | |
function noise( ctx, rgba, min, max ) | |
{ |
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
<style> | |
html, body{ | |
width:100%; | |
height:100%; | |
overflow: hidden; | |
top:0; | |
left:0; | |
margin:0; | |
padding:0; | |
} |
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
//from https://math.stackexchange.com/questions/296794/finding-the-transform-matrix-from-4-projected-points-with-javascript/339033#339033 | |
// and http://jsfiddle.net/dFrHS/1/ | |
function adj(m) { // Compute the adjugate of m | |
return [ | |
m[4]*m[8]-m[5]*m[7], m[2]*m[7]-m[1]*m[8], m[1]*m[5]-m[2]*m[4], | |
m[5]*m[6]-m[3]*m[8], m[0]*m[8]-m[2]*m[6], m[2]*m[3]-m[0]*m[5], | |
m[3]*m[7]-m[4]*m[6], m[1]*m[6]-m[0]*m[7], m[0]*m[4]-m[1]*m[3] | |
]; | |
} |
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
/** | |
* Created by nico on 19/02/14. | |
*/ | |
var Object3d = function( node, position, rotation ) | |
{ | |
this.node = node; | |
this.parent = null; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>postmortem</title> | |
<style> | |
html, body{ | |
width:100%; | |
height:100%; | |
overflow: hidden; |
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
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title>MIXER</title> | |
<style> | |
head, body{ | |
width:100%; | |
height:100%; | |
overflow: hidden; |
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
function bresenhamCircle( cx,cy,r ) | |
{ | |
var x = 0,y = r,p; | |
ctx.fillRect( cx+x,cy-y, 1, 1 ); | |
p=3-(2*r); | |
for(x=0;x<=y;x++) | |
{ |