< back to sketchPatch discussionblogsimilar sitesflickrfacebooktwittergoogle wave join the sketchPatch hardcore crew
discussionblogsimilar sitesflickrfacebooktwittergoogle wave join the sketchPatch hardcore crew
The noise() and bezierPoint() functions don't seem to be supported at the moment. bezierPoint() is easy enough to replace but noise() (generates Perlin noise) is a bit trickier.
An inefficient bezierPoint implementation:float jsBezierPoint(float s, float cp1, float cp2, float d, float t) { float b, t0, t1, t2, t3; t0 = pow(1-t, 3) * s; t1 = 3 * sq(1-t) * t * cp1; t2 = 3 * (1-t) * sq(t) * cp2; t3 = pow(t, 3) * d; b = t0 + t1 + t2 + t3; return b;}
float jsBezierPoint(float s, float cp1, float cp2, float d, float t) { float b, t0, t1, t2, t3; t0 = pow(1-t, 3) * s; t1 = 3 * sq(1-t) * t * cp1; t2 = 3 * (1-t) * sq(t) * cp2; t3 = pow(t, 3) * d; b = t0 + t1 + t2 + t3; return b;}
Noted, thanks for spotting and reporting that!
The noise() and bezierPoint() functions don't seem to be supported at the moment. bezierPoint() is easy enough to replace but noise() (generates Perlin noise) is a bit trickier.
An inefficient bezierPoint implementation:
float jsBezierPoint(float s, float cp1, float cp2, float d, float t) {
float b, t0, t1, t2, t3;
t0 = pow(1-t, 3) * s;
t1 = 3 * sq(1-t) * t * cp1;
t2 = 3 * (1-t) * sq(t) * cp2;
t3 = pow(t, 3) * d;
b = t0 + t1 + t2 + t3;
return b;
}