{{ message }}

Instantly share code, notes, and snippets.

# kouseiikeda ikekou

Created May 23, 2020
View draw-line.frag
 // Draw Line https://www.shadertoy.com/view/4ljfRD float drawLine (vec2 p1, vec2 p2, vec2 uv, float a) { float r = 0.; float one_px = 1. / iResolution.x; //not really one px // get dist between points float d = distance(p1, p2);
Created May 22, 2020
View random2.frag
 // https://thebookofshaders.com/12/?lan=jp vec2 random2( vec2 p ) { return fract(sin(vec2(dot(p,vec2(127.1,311.7)),dot(p,vec2(269.5,183.3))))*43758.5453); }
Created May 22, 2020
View simplex-noise.frag
 // https://thebookofshaders.com/edit.php#11/2d-snoise-clear.frag vec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; } vec2 mod289(vec2 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; } vec3 permute(vec3 x) { return mod289(((x*34.0)+1.0)*x); } // // Description : GLSL 2D simplex noise function // Author : Ian McEwan, Ashima Arts // Maintainer : ijm
Last active May 22, 2020
 vec2 random2(vec2 st){ st = vec2( dot(st,vec2(127.1,311.7)), dot(st,vec2(269.5,183.3)) ); return -1.0 + 2.0*fract(sin(st)*43758.5453123); } // Gradient Noise by Inigo Quilez - iq/2013 // https://www.shadertoy.com/view/XdXGW8 float noise2(vec2 st) { vec2 i = floor(st);
Last active May 19, 2020
get closest point on line with specific point
View closestXY.js
 function closestXY(x0,y0,x1,y1, mx, my) { var dx = x1 - x0; var dy = y1 - y0; var t = ((mx - x0) * dx + (my - y0) * dy) / (dx * dx + dy * dy); t = Math.max(0, Math.min(1, t)); var x = lerp(x0, x1, t); var y = lerp(y0, y1, t);
Created Apr 14, 2015
[JavaScript][CoffeeScript] stats.js貼り付け用
View CDN
 https://cdnjs.cloudflare.com/ajax/libs/stats.js/r11/Stats.min.js
Last active Sep 20, 2018
[WordPress] OGP