Last active
September 28, 2021 18:11
-
-
Save khoparzi/bb5c29b5e20cfde5d7a88a70c3629227 to your computer and use it in GitHub Desktop.
Almost a month's worth of Marching.js sketches exploring various experiments with Julia fractals through the month of July 2020. Marching.js is a JavaScript shader compiler specifically focused on ray marching via signed distance functions.
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
// Try these at https://charlieroberts.github.io/marching/playground/ | |
// 1 Jul | |
march( | |
mb = Julia() | |
.material(Material('phong', Vec3(.0), Vec3(.5), Vec3(1), 32, Vec3(0))), | |
Plane(Vec3(0, 0, 1), 0.5).material('white glow') | |
) | |
.fog( .2, Vec3(0.25, 0.3, 0) ) | |
//.background( Vec3(.25) ) | |
.light( | |
l1 = Light(Vec3(-1,1,5), Vec3(1), 0.25) | |
//l2 = Light(Vec3(-2,1,5), Vec3(1), 0.5) | |
) | |
.render('fractal.high') | |
.camera(0,0,5) | |
onframe = t => { | |
mb.fold = 2 + (sin(t * 0.0625) * 5) | |
mb.rotate(t * 10, 0, 0, 2) | |
mb.move(0, 0, 1 + sin(t * 0.0625) * 1) | |
} | |
// 1 Jul - Audio reactive | |
march( | |
mb = Julia() | |
.material(Material('phong', Vec3(.0), Vec3(.5), Vec3(1), 32, Vec3(0))), | |
Plane(Vec3(0, 0, 1), 0.5).material('white glow') | |
) | |
.fog( .2, Vec3(0.25, 0.3, 0) ) | |
//.background( Vec3(.25) ) | |
.light( | |
l1 = Light(Vec3(-1,1,5), Vec3(1), 0.25), | |
l2 = Light(Vec3(-2,1,5), Vec3(1), 0.5) | |
) | |
.render('fractal.high') | |
.camera(0,0,4.5) | |
onframe = t => { | |
//mb.fold = 2 + (sin(t * 0.0625) * 5) | |
mb.fold = 1 + (FFT.mid * 10) | |
mb.rotate(t * 20, 1, 0.5, 1) | |
mb.move(0, 0, 1 + FFT.low * 0.15) | |
} | |
FFT.start([200, 600, 1200, 2400, 4800]) | |
// 2 Daft Rodent | |
march( | |
un = StairsUnion( | |
Sphere(0.7), | |
ju = Julia() | |
).rotate(90, 0, 1, 0).material(Material('phong', Vec3(.0), Vec3(.5), Vec3(0.2), 32, Vec3(0))) | |
).light( | |
Light(Vec3(-3, 2, 2), Vec3(1), 0.25), | |
Light(Vec3(-1, -2, 5), Vec3(1), 0.25) | |
).render('fractal.high') | |
onframe = t => { | |
ju.fold = 5 + sin(t * 0.0625) * 5 | |
//ju.rotate(t * 30, 1, 0, 0) | |
} | |
// 3 July | |
march( | |
un = StairsUnion( | |
Sphere(0.7), | |
ju = Julia() | |
).rotate(90, 1, 1, 0).material(Material('phong', Vec3(.0), Vec3(.5), Vec3(1), 32, Vec3(0))) | |
).light( | |
Light(Vec3(-3, 2, 2), Vec3(1), 0.25), | |
Light(Vec3(1, -2, 5), Vec3(1), 0.25) | |
).render('fractal.high') | |
onframe = t => { | |
ju.fold = 5 + sin(t * 0.0625) * 10 | |
ju.rotate(t * 120, 1, 0, 0) | |
un.move(0, 0, (-2) + FFT[3] * 2) | |
} | |
FFT.start([200, 600, 1200, 2400, 4800]) | |
// 4 July | |
march( | |
su = StairsUnion( | |
ju = Julia(), | |
pl = Repeat(Sphere(0.014), 1) | |
).rotate(90, 0, 0, 0).material(Material('phong', Vec3(.0), Vec3(.4), Vec3(1), 32, Vec3(0))) | |
).background(Vec3(0.7)).render('fractal.high') | |
onframe = t => { | |
ju.rotate(t * 180, 0, 2, 0) | |
ju.move(0, 0, FFT[4] * 3) | |
pl.rotate(t * 90, -1, sin(t * 0.125) * 0.5, 0) | |
pl.move(0, FFT[1] - 1, FFT[3] * 4) | |
ju.fold = FFT[2] * 10 | |
} | |
FFT.start([200, 600, 1200, 2400, 4800]) | |
// 5 July | |
march( | |
//Repeat( | |
sd = StairsUnion( | |
ju = Julia().rotate(90, 1, 1, 0),//.scale(1.5,1.5,2), | |
rpi = Repeat( sp = Sphere( .012 ), .5 ), | |
.5, 4 | |
) | |
//, 3) | |
//.translate( 0,-1.5 ) | |
.material('white glow') | |
//Plane().texture( 'cellular', { strength:-.5, scale:10 }) | |
) | |
//.fog( .01, Vec3(.5) ) | |
.background( Vec3(.5, 0.2, 0.2) ) | |
.render('fractal.high') | |
onframe = t => { | |
rpi.distance = FFT[3] + 0.3 | |
rpi.rotate(t * 60, 0, -1, 0) | |
ju.fold = 5 | |
ju.rotate(30 * t, 1, 1, 0) | |
//ju.move(0, 1 - FFT[0], 0) | |
sp.radius = 0.01 + (FFT[0] * 0.1) - 0.21 | |
} | |
FFT.start([200, 500, 2000, 8000]) | |
// 6 July | |
march( | |
RoundUnion( | |
Sphere(), | |
ju = Julia() | |
.scale(2.5,2.5,2) | |
.translate(0,-1.5,0) | |
).translate(0, 1.5, 0).material(Material('phong', Vec3(.5), Vec3(1), Vec3(1), 32, Vec3(0))), | |
) | |
.light( | |
//Light(Vec3(3, 2, 5), Vec3(1), 0.2 5), | |
Light(Vec3(-2, 2, 4), Vec3(0.5, 0.5, 0.75), 0.5) | |
).background(Vec3(0.3, 0.3, 0.2)) | |
.render('fractal.high').camera(0, 0.5, 10) | |
onframe = t => { | |
ju.fold = t * 0.04 | |
ju.rotate((t * 0.25) * 30, .23, .53, 0) | |
} | |
FFT.start([200, 400, 600, 800, 1200, 4800, 8000, 12000]) | |
// 7 July | |
march( | |
pr = PolarRepeat( | |
ju = Julia(), 3, 0.5) | |
.material(Material('phong', Vec3(.5), Vec3(1), Vec3(.3, .4, .5), 32, Vec3(.430))) | |
) | |
.background(Vec3(.4, .5, .5)) | |
.light(Light(Vec3(-2, 2, 4), Vec3(0.75), 0.5)) | |
.render('fractal.high') | |
.camera( 0, 0, 6 ) | |
onframe = t => { | |
//ju.fold = 0.7012 + (cos(t * 0.125) * 0.5) | |
ju.fold = (FFT[5] * 2) | |
ju.rotate(t * 60, 1, 0, 0) | |
pr.rotate(45 * t, 0, .8, .9) | |
pr.distance = 0.25 + FFT[1] | |
} | |
FFT.start([200, 400, 600, 800, 1200, 4800, 8000, 12000]) | |
// /////////////////////////////// | |
// 8 July | |
march( | |
tw = Twist(ju = Julia()).material('glue') | |
).render('fractal.high').camera(0,0,3) | |
onframe = t => { | |
ju.fold = sin(t) | |
tw.amount = Vec3(sin(t)) | |
ju.rotate(t * 30, 0, sin(t), 0) | |
} | |
//////////////////////////// | |
// 9 July | |
march( | |
m3 = Mirror( | |
ju = Julia(0.8).translate(0.5, 0.3, 0.5).rotate(30, 1, 1, 0) | |
).material(Material('phong', Vec3(.0), Vec3(.5), Vec3(0.2), 32, Vec3(0))) | |
).light( | |
Light(Vec3(-3, 2, 2), Vec3(1), 0.25), | |
Light(Vec3(-1, -2, 5), Vec3(1), 0.25) | |
).background(Vec3(0.3, 0, 0)).render('fractal.high').camera(0, 0, 2) | |
onframe = t => { | |
//m3.rotate(t * 30, 0, 1, 0) | |
ju.rotate(t * 30, 1, 0, 0) | |
} | |
//////// | |
// 10 July | |
march( | |
m3 = Mirror( | |
ju = Julia(0.8).translate(0.5, 0.3, 0.5).rotate(45, 1, 1, 0) | |
).rotate(90, 0, 1, 0).material(Material('phong', Vec3(.0), Vec3(.5), Vec3(0.2), 32, Vec3(0))) | |
).light( | |
Light(Vec3(-3, 2, 2), Vec3(1), 0.25) | |
).background(Vec3(0.12, 0, 0.3)).render('fractal.high').camera(0, 0, 4) | |
onframe = t => { | |
ju.fold = 0.8 + (FFT[0] * 0.2) | |
m3.rotate(t * 20, 0, sin(t), cos(t)) | |
} | |
FFT.start([200, 400, 600, 800, 1200, 4800, 8000, 12000]) | |
////////////////// | |
// 11 July | |
march( | |
Mirror(ju = Julia()).rotate(90, 0, 1, 0).material('white') | |
).render('fractal.high').camera(0, 0, 2.3) | |
onframe = t => { | |
ju.fold = FFT[2] | |
ju.rotate(t * 30, 1, 0, 0) | |
} | |
FFT.start([200, 400, 600, 800, 1200, 4800, 8000, 12000]) | |
//////////////////////// | |
// 13 July | |
march( | |
mr = Mirror( | |
Intersection( | |
ju = Julia(1.5), | |
cy = Cylinder(Vec2(1, 0.15)).rotate(90, 0, 0, 1) | |
).translate(0, 0.5, 0).rotate(45, 1, 1, 0) | |
).material(Material('phong', Vec3(.0), Vec3(.5), Vec3(0.2), 32, Vec3(0))) | |
).light(l1 = Light(Vec3(2, 0, 3), Vec3(0.5), 0.5)).background(Vec3(0.85, 0.6, .0)) | |
.render('fractal.high').camera(0, 0, 3.5) | |
onframe = t => { | |
mr.rotate(t * 30, 0, 1, 0) | |
cy.translate(((t / 64) % 1) * 2 - 1.5, 0, 0) | |
} | |
//////////////////////// | |
// 14 July | |
mat1 = Vec3(0.365, 0.16, .0) | |
march( | |
mr = PolarRepeat( | |
Intersection( | |
ju = Julia(1.5), | |
cy = Cylinder(Vec2(1, 0.15)).rotate(90, 1, 0, 1) | |
).translate(0, -0.45, 0).rotate(90, 0, 0, 1) | |
, 4, .5).material(Material('phong', mat1, mat1, Vec3(0.2, 0.1, 0), 2, Vec3(0))) | |
).light( | |
l1 = Light(Vec3(2, 0, 3), Vec3(0.25), 0.125) | |
, l2 = Light(Vec3(-1, 0, 2), Vec3(0, 0, 0.125), 0.4) | |
).background(Vec3(0.256)) | |
.render(10, true).camera(0, 0, 3.5) | |
onframe = t => { | |
//ju.rotate(t * 30, 1, 1, 0) | |
mr.rotate(t * 30, 0, -1, 0) | |
//cy.translate(sin(t) * 0.5, 0, 0) | |
cy.translate((sin(t * 0.5) * 0.25 + 0.25) + 0.25, 0, 0) | |
} | |
/////////////////////////// | |
// 15 July | |
mat1 = Vec3(0.5, 0.8, .0) | |
march( | |
si = StairsIntersection( | |
ju = Julia(.875).scale(2).rotate(90, 0, 0.5, 1) | |
, rpt = Repeat(Sphere(.1), .15) | |
, .125) | |
.material(Material('phong', mat1, mat1, Vec3(0.2, 0.1, 0), 2, Vec3(0))) | |
).light( | |
l1 = Light(Vec3(3, 0, 3), Vec3(0.25), 0.125) | |
, l2 = Light(Vec3(-2, 0, 2), Vec3(0, 0, 0.125), 0.4) | |
).render('fractal.high') | |
onframe = t => { | |
rpt.rotate(t * 20, 0, -1, 0) | |
rpt.distance.y = FFT[4] * FFT[1] * 0.3 + 0.1 | |
} | |
FFT.start([200, 400, 600, 800, 1200, 4800, 8000, 12000]) | |
///////////////////////////////// | |
// 16 July | |
mat1 = Vec3(1, .07, .3) | |
march( | |
Difference( | |
mb = Mandelbox(.12, 3), | |
sp = Sphere(3).translate(0, 0, 3), | |
).material('white glow'), | |
ints = Intersection( | |
ju = Julia(.6).rotate(90, 0, 0, 1), | |
rpt = Repeat(cy = Cylinder(Vec2(1.5, 0.00125)), Vec3(2, .085, 2)).translate(2.5, 0, 0) | |
).material(Material('phong', mat1, mat1, Vec3(0.2), 2, Vec3(0))).translate(0, 0, .5) | |
).light(Light(Vec3(3, 0, 2), Vec3(0.25), 0.25)).background(0.5).render('fractal.high') | |
onframe = t => { | |
mb.rotate(t * 5, 1, 0, 0) | |
ints.rotate(t * 90, 0, 1, 0) | |
rpt.distance.y = FFT[1] * 0.1 | |
} | |
FFT.start([200, 400, 600, 800, 1200, 4800, 8000, 12000]) | |
///////////////////////////////////// | |
// 17 July | |
march( | |
rpt = Mirror( | |
ju = Julia(1.3) | |
).material('glue') | |
) | |
.background(Vec3(1, .07, .3)) | |
.render('fractal.high').camera(0, 0, 2) | |
onframe = t => { | |
ju.fold = 1.5 + FFT[7] * .3 | |
ju.rotate(90 * t, 1, 0, 0) | |
rpt.rotate(30 * t, 0, 0, 1) | |
} | |
FFT.start([200, 400, 600, 800, 1200, 4800, 8000, 12000]) | |
/////////////////////////////////// | |
// 18 July | |
march( | |
m1 = Mirror(un = StairsUnion( | |
Sphere(0.2), | |
ju = Julia(1.6) | |
).rotate(90, 0, 0, 1) | |
).material(Material('phong', Vec3(.0), Vec3(.5), Vec3(0.2), 2, Vec3(0))) | |
).post(rays = Godrays()).render('fractal.high') | |
rays.color = [1, 1, 1] | |
rays.decay = 1.01 | |
rays.threshold = 1 | |
onframe = t => { | |
ju.fold = FFT[4] * 1.4 | |
ju.rotate((FFT[6] * 180) - 90, 1, -1, -1) | |
m1.rotate(90, 1, 0, 0) | |
} | |
FFT.start([200, 400, 600, 800, 1200, 4800, 8000, 12000]) | |
///// | |
// 19 July | |
march( | |
ju = Union(juj = Julia(1.3).material('glue').rotate(90, 0, 0, 1), Sphere(.2)) | |
, rpt = Repeat(Sphere(.2), 2, Vec3(0.5)).material('red') | |
).post(ed = Focus(0.5,0.12)).render('fractal.high') | |
onframe = t => { | |
ju.rotate(45 * t, .5, .25, 0.2) | |
//ju.rotate(90, 0, 0, 1) | |
rpt.translate(0, 0, FFT[3]) | |
rpt.rotate(90 * t, sin(t * .5), sin(t), 0) | |
juj.fold = 1.2 - FFT[6] * .5 | |
} | |
FFT.start([200, 400, 600, 800, 1200, 4800, 8000, 12000]) | |
// 20 July - Look inside | |
march( | |
Mirror(ha = Halve( | |
//Onion(//Onion( | |
ju = Julia(.5) | |
//, 0.025)//, 0.025) | |
, Halve.LEFT)).material('white') | |
).background(Vec3(0, 0.5, 0.75)) | |
.render('fractal.high').camera(0, 0, 3) | |
onframe = t => { | |
ju.fold = (t * 0.0125) * 3 | |
ju.rotate(90, 0, 1, 0) | |
//ha.rotate(90, 0, 1, 0) | |
ha.rotate(30 * t, 0, 1, 0) | |
} | |
//////////////////// | |
// 21 July 2020 | |
// Khoparzi @khoparzi | |
// http://khoparzi.com | |
march( | |
RoundUnion( | |
rpt = Repeat(ju = Julia(1.3).scale(0.125), Vec3(.5, .5, 2)).translate(0, -2.5, 0), | |
Plane(), | |
0.125 | |
).material('white glow') | |
).render('fractal.high').camera(0,0,0) | |
onframe = t => { | |
rpt.rotate(FFT[3] * 10, FFT[4] * 10, FFT[7] * 10) | |
//ju.translate(FFT[3] * 2, FFT[4] * 2, 1 - FFT[7] * 2) | |
ju.fold = FFT[5] * 2 | |
} | |
FFT.start([200, 400, 600, 800, 1200, 2400, 4800, 8000, 16000]) | |
// 22 July 2020 | |
// Khoparzi @khoparzi | |
// http://khoparzi.com | |
mat1 = Vec3(.9, .5, 0.1) | |
Material.default = Material('phong', mat1, mat1, Vec3(.32), 32, Vec3(.3)) | |
march( | |
tw = Twist( | |
ju = Julia(Math.PI * 9).scale(2, 2, 2).rotate(90, 0, 0, 1), Vec3(1.5) | |
) | |
).light( | |
l1 = Light(Vec3(1, 0, 3), Vec3(0.25), 0.7) | |
, l2 = Light(Vec3(-2, 0, 2), Vec3(0.125), 0.8) | |
).background(0.1) | |
.render('fractal.high') | |
.camera(0, 0, 7) | |
onframe = t => { | |
ju.fold = sin(t / 32) * 8 | |
ju.rotate(90 * t, 0, 0, -1) | |
} | |
https://charlieroberts.github.io/marching/playground/index.htm?Ly8gMjIgSnVseSAyMDIwCi8vIEtob3BhcnppIEBraG9wYXJ6aQovLyBodHRwOi8va2hvcGFyemkuY29tIAoKbWF0MSA9IFZlYzMoLjksIC41LCAwLjEpCk1hdGVyaWFsLmRlZmF1bHQgPSBNYXRlcmlhbCgncGhvbmcnLCBtYXQxLCBtYXQxLCBWZWMzKC4zMiksIDMyLCBWZWMzKC4zKSkKbWFyY2goCiAgdHcgPSBUd2lzdCgKICAgIGp1ID0gSnVsaWEoTWF0aC5QSSAqIDkpLnNjYWxlKDIsIDIsIDIpLnJvdGF0ZSg5MCwgMCwgMCwgMSksIFZlYzMoMS41KQogICkKKS5saWdodCgKICBsMSA9IExpZ2h0KFZlYzMoMSwgMCwgMyksIFZlYzMoMC4yNSksIDAuNykKICAsIGwyID0gTGlnaHQoVmVjMygtMiwgMCwgMiksIFZlYzMoMC4xMjUpLCAwLjgpCikuYmFja2dyb3VuZCgwLjEpCiAgLnJlbmRlcignZnJhY3RhbC5oaWdoJykKICAuY2FtZXJhKDAsIDAsIDcpCgoKb25mcmFtZSA9IHQgPT4gewoganUuZm9sZCA9IHNpbih0IC8gMzIpICogOAoganUucm90YXRlKDkwICogdCwgMCwgMCwgLTEpCn0K | |
// 23 July | |
use('hydra').then( () => { | |
h = Hydra() | |
voronoi(10, 0.01).kaleid(15) | |
.colorama(0.5, 0.25, 0.2) | |
.modulateScale(o0, 0.2) | |
.blend(osc(10, -0.1, 1).kaleid(50)) | |
.scale(2) | |
.out() | |
march( | |
Union(ju = Julia(1.3).texture(h.texture()), Sphere(.3)).rotate(90, 0, 1, 0) | |
).render('fractal.high') | |
onframe = t => { | |
ju.rotate(t *5, 1, 0, 0) | |
} | |
}) | |
https://charlieroberts.github.io/marching/playground/index.htm?dXNlKCdoeWRyYScpCi50aGVuKCAoKSA9PiB7CgogIGggPSBIeWRyYSgpCiAgdm9yb25vaSgxMCwgMC4wMSkua2FsZWlkKDE1KQogICAgLmNvbG9yYW1hKDAuNSwgMC4yNSwgMC4yKQogICAgLm1vZHVsYXRlU2NhbGUobzAsIDAuMikKICAgIC5ibGVuZChvc2MoMTAsIC0wLjEsIDEpLmthbGVpZCg1MCkpCiAgICAuc2NhbGUoMikKICAgIC5vdXQoKQoKICBtYXJjaCgKICAgIFVuaW9uKGp1ID0gSnVsaWEoMS4zKS50ZXh0dXJlKGgudGV4dHVyZSgpKSwgU3BoZXJlKC4zKSkucm90YXRlKDkwLCAwLCAxLCAwKQogICkucmVuZGVyKCdmcmFjdGFsLmhpZ2gnKQoKICBvbmZyYW1lID0gdCA9PiB7CiAgICBqdS5yb3RhdGUodCAqNSwgMSwgMCwgMCkKICB9Cn0pCg== | |
// 24 July | |
Material.default = Material('phong', Vec3(1), Vec3(1), Vec3(1), 2, Vec3(1)) | |
march( | |
Bend(ju = Julia(Math.PI).rotate(90, 1, 1, 0), Vec2(1)) | |
).background(Vec3(0.5, 0.5, 0)).render('fractal.high') | |
onframe = t => { | |
ju.rotate(90 * t, 1, 1, 0) | |
} | |
https://charlieroberts.github.io/marching/playground/index.htm?Ly8gMjQgSnVseSAyMDIwCi8vIEtob3BhcnppIEBraG9wYXJ6aQovLyBodHRwOi8va2hvcGFyemkuY29tIAoKCk1hdGVyaWFsLmRlZmF1bHQgPSBNYXRlcmlhbCgncGhvbmcnLCBWZWMzKDEpLCBWZWMzKDEpLCBWZWMzKDEpLCAyLCBWZWMzKDEpKQptYXJjaCgKICBCZW5kKGp1ID0gSnVsaWEoTWF0aC5QSSkucm90YXRlKDkwLCAxLCAxLCAwKSwgVmVjMigxKSkKKS5iYWNrZ3JvdW5kKFZlYzMoMC41LCAwLjUsIDApKS5yZW5kZXIoJ2ZyYWN0YWwuaGlnaCcpLmNhbWVyYSgwLCAwLCAzKQoKb25mcmFtZSA9IHQgPT4gewogIGp1LnJvdGF0ZSg2MCAqIHQsIDEsIDEgJSBzaW4odCksIDApCn0KCg== | |
// 25 July 2020 | |
// Khoparzi @khoparzi | |
// http://khoparzi.com | |
mat1 = Vec3(0.73, 0.73, 0.8) | |
Material.default = Material('phong', mat1, mat1, Vec3(.0), 32, Vec3(.6)) | |
march( | |
Halve( | |
diff = Difference( | |
Sphere() | |
, ju = Julia(Math.PI).rotate(90, 0, 1, 0) | |
) | |
, Halve.LEFT).rotate(90, 0, 1, 0) | |
).render('fractal.high').camera(0, 0, 2) | |
onframe = t => { | |
ju.fold = sin(t * Math.PI * 0.125) | |
diff.rotate(90 * t, 1, 1, 0) | |
} | |
https://charlieroberts.github.io/marching/playground/index.htm?Ly8gMjUgSnVseSAyMDIwCi8vIEtob3BhcnppIEBraG9wYXJ6aQovLyBodHRwOi8va2hvcGFyemkuY29tIAoKbWF0MSA9IFZlYzMoMC43MywgMC43MywgMC44KQpNYXRlcmlhbC5kZWZhdWx0ID0gTWF0ZXJpYWwoJ3Bob25nJywgbWF0MSwgbWF0MSwgVmVjMyguMCksIDMyLCBWZWMzKC42KSkKbWFyY2goCiAgSGFsdmUoCiAgICBkaWZmID0gRGlmZmVyZW5jZSgKICAgICAgU3BoZXJlKCkKICAgICAgLCBqdSA9IEp1bGlhKE1hdGguUEkpLnJvdGF0ZSg5MCwgMCwgMSwgMCkKICAgICkKICAsIEhhbHZlLkxFRlQpLnJvdGF0ZSg5MCwgMCwgMSwgMCkKKS5yZW5kZXIoJ2ZyYWN0YWwuaGlnaCcpLmNhbWVyYSgwLCAwLCAyKQoKb25mcmFtZSA9IHQgPT4gewogIGp1LmZvbGQgPSBzaW4odCAqIE1hdGguUEkgKiAwLjEyNSkKICBkaWZmLnJvdGF0ZSg5MCAqIHQsIDEsIDEsIDApCn0K | |
// 27 July 2020 | |
// Khoparzi @khoparzi | |
// http://khoparzi.com | |
mat1 = Vec3(0.73, 0.73, 0.8) | |
Material.default = Material('phong', mat1, mat1, Vec3(.0), 32, Vec3(.6)) | |
march( | |
diff = Pipe( | |
Sphere() | |
, ju = Julia(Math.PI).rotate(90, 0, 1, 0) | |
, 0.25) | |
) | |
.background( | |
Vec3(.125,0,.125) | |
) | |
.light( | |
Light( Vec3(4), Vec3(1,0,1), .1) | |
) | |
.post( | |
//rays = Godrays( 1.01,.01,1,.65 ) | |
Bloom(.4) | |
).render('fractal.high').camera(0, 0, 3) | |
onframe = t => { | |
ju.fold = sin(t * Math.PI * 0.125) | |
diff.rotate(90 * t, 1, -1, 0) | |
} | |
https://charlieroberts.github.io/marching/playground/index.htm?Ly8gMjcgSnVseSAyMDIwCi8vIEtob3BhcnppIEBraG9wYXJ6aQovLyBodHRwOi8va2hvcGFyemkuY29tIAoKbWF0MSA9IFZlYzMoMC43MywgMC43MywgMC44KQpNYXRlcmlhbC5kZWZhdWx0ID0gTWF0ZXJpYWwoJ3Bob25nJywgbWF0MSwgbWF0MSwgVmVjMyguMCksIDMyLCBWZWMzKC42KSkKbWFyY2goCiAgZGlmZiA9IFBpcGUoCiAgICAgIFNwaGVyZSgpCiAgICAgICwganUgPSBKdWxpYShNYXRoLlBJKS5yb3RhdGUoOTAsIDAsIDEsIDApCiAgLCAwLjI1KQopCi5iYWNrZ3JvdW5kKCAKICBWZWMzKC4xMjUsMCwuMTI1KSAKKQoubGlnaHQoIAogIExpZ2h0KCBWZWMzKDQpLCBWZWMzKDEsMCwxKSwgLjEpCikKLnBvc3QoIAogIC8vcmF5cyA9IEdvZHJheXMoIDEuMDEsLjAxLDEsLjY1ICkgCiAgQmxvb20oLjQpCikucmVuZGVyKCdmcmFjdGFsLmhpZ2gnKS5jYW1lcmEoMCwgMCwgMykKCm9uZnJhbWUgPSB0ID0+IHsKICBqdS5mb2xkID0gc2luKHQgKiBNYXRoLlBJICogMC4xMjUpCiAgZGlmZi5yb3RhdGUoOTAgKiB0LCAxLCAtMSwgMCkKfQo= | |
// 28 July | |
// inspired by fasttriggerfish and thecharlie | |
// Plays in https://gibber-cc.github.io/gibber/playground/ | |
Clock.bpm = 120 | |
Theory.root = 'd#4' | |
Theory.mode = 'dorian' | |
verb = Bus2( 'spaceverb' ) | |
delay = Bus2( 'delay.1/6' ) | |
pad = PolySynth('rhodes', { decay:5, gain:.15 }) | |
pad.fx[0].connect( Out, .125) | |
pad.fx[0].connect( verb, 1 ) | |
pad.chord.seq([[0,3,4,6], [1,2,5,7]], [1/8, 1/4, 2] ) | |
Theory.degree.seq( ['i','-iv','-V'], [8,4,4] ) | |
un = Union( | |
ju = Julia().rotate(90, 1, 1, 0), | |
rpt = Repeat(Sphere(0.1), 0.25) | |
).background(0.3, 0.7, 0.3) | |
.render('fractal.high') | |
ju.fold.map(pad, -2, 3) | |
Material.default = Material('phong', Vec3(.3), Vec3(.3), Vec3(0), 2, Vec3(.5)) | |
kick = Kick() | |
kick.note.tidal('-12*2 ~ -12 0 ~ ~ 0 <7*1 12*2>') | |
hat = Hat() | |
hat.trigger.seq([.3, .1], Euclid(7,16)/* 1001010010101010 */ , 1) | |
rpt.distance.y.map(kick, 2, 1) | |
rpt.distance.x.map(kick, 2, 1) | |
onframe = t => { | |
rpt.rotate(90 * t, 0, 0, 1) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment