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
// FROM https://gist.github.com/IkarosKappler/d3c39db08115085bcb18#file-fix_by_ikaros-js | |
// used in https://codepen.io/loficodes/pen/MWENJxL/d06de09715a270406e86f5cbc0b3c16e?editors=1111 | |
// usage | |
loader.load("https://assets.codepen.io/5946/fish_1.glb", function (gltf) { | |
fish = gltf.scene; | |
const svg = document.getElementById(svgName); | |
const origPoints = getCenteredSVGPoints(svg, 0.025); | |
const fishPoints = getFishPointsFromPoints(origPoints); |
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
## Generic 1,2,3 Noise | |
``` | |
float rand(float n){return fract(sin(n) * 43758.5453123);} | |
float noise(float p){ | |
float fl = floor(p); | |
float fc = fract(p); | |
return mix(rand(fl), rand(fl + 1.0), fc); | |
} |
NewerOlder