Skip to content

Instantly share code, notes, and snippets.

View moonraker22's full-sized avatar
πŸ’­
πŸŒ™ Above the clouds

MooNRakeR (Zac Kesler) moonraker22

πŸ’­
πŸŒ™ Above the clouds
View GitHub Profile
@moonraker22
moonraker22 / transformSvgPath.js
Last active March 31, 2023 02:04
transform an svg to a path in three js
// 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);
@moonraker22
moonraker22 / GLSL-Noise.glsl
Last active April 16, 2023 06:59 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms
## 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);
}