Skip to content

Instantly share code, notes, and snippets.

View charlieroberts's full-sized avatar

charlie roberts charlieroberts

View GitHub Profile
const marching_blob = await fetch('https://cdn.jsdelivr.net/gh/charlieroberts/marching@main/dist/index.js')
const marching_txt = await marching_blob.text()
eval( marching_txt )
window.screamer = await import('https://cdn.jsdelivr.net/gh/charlieroberts/screamer@latest/screamer.js')
window.screamer = screamer.default
const screamerlang_blob = await fetch('https://cdn.jsdelivr.net/gh/charlieroberts/screamer@latest/screamer-lang.js')
const screamerlang_txt = await screamerlang_blob.text()
eval( screamerlang_txt )
@charlieroberts
charlieroberts / screamer.hydra.js
Last active March 11, 2025 04:21
Small setup script to use screamer inside of hydra
const marching_blob = await fetch('https://cdn.jsdelivr.net/gh/charlieroberts/marching@main/dist/index.js')
const marching_txt = await marching_blob.text()
eval( marching_txt )
window.screamer = await import('https://cdn.jsdelivr.net/gh/charlieroberts/screamer@latest/screamer.js')
window.screamer = screamer.default
const screamerlang_blob = await fetch('https://cdn.jsdelivr.net/gh/charlieroberts/screamer@latest/screamer-lang.js')
const screamerlang_txt = await screamerlang_blob.text()
eval( screamerlang_txt )
ConductorM = {
add( ...agents ) {
ConductorM.agents.push( ...agents )
},
agents:[],
articulation( v ) {
},

a gist for storing readme imagesfeedback_sm

@charlieroberts
charlieroberts / swg_api.md
Created September 16, 2022 16:58
simulation api

inRange - sum - equals - getProp - setProp - move - convenience that calls setProp on x,y,z

@charlieroberts
charlieroberts / hydra.md
Created August 24, 2022 17:52
a short hydra tutorial

Hydra

You can find Hydra at: < hydra >

The easiest way to get started is to start changing numbers in existing sketches (you can load new random sketches by hitting the reload button in the upper right corner) and hitting ctrl+shift+enter to see how your results change after modifying the code.

There’s lots of commented examples to look at here: hydra-examples/0-getting-started.js at master · ojack/hydra-examples · GitHub

And there’s documentation for the various functions at: hydra/funcs.md at master · ojack/hydra · GitHub

Let’s start by creating an oscillator similar to what we did in The Force:

@charlieroberts
charlieroberts / ray_marching_materials.md
Last active September 17, 2020 18:21
links for online talk/workshop on ray marching and the demoscene
@charlieroberts
charlieroberts / equinox_marchingjs.md
Created March 21, 2020 00:38
Equinox Marching.js Tutorial

Marching.js

This demo tutorial will mainly focus on getting started using marching.js playground, a browser-based tool for live coding with ray marchers. I’ve added some extra information at the beginning on the demoscene, which was an important source of inspiration for marching.js. Here’s a recent article on the demoscene: Here’s some Sanity, literally, and Amiga Dreams as read for you in French - CDM Create Digital Music

Demoscene

The demoscene is a culture that began in the 1980s, when hackers created “cracktros” for the software they cracked… these were short audiovisual demos that showed off the skills of the hacker and often contained shoutouts to their other hackers / friends.

Over time, some hackers/artists became more interested in the audiovisual demos than they were in pirating software, and this became the birth of the “demoscene”, where programmers would create audiovisual “demos” that

@charlieroberts
charlieroberts / march_10_julia_twist.js
Created March 11, 2020 19:24
A Julia set rotating through a twist
// copy and paste into https://charlieroberts.github.io/marching/playground/
// select all and hit ctrl+enter
mat1 = Material( 'phong', .05, 1, .5 )
mat2 = Material( 'phong', 0, .1, .25 )
march(
t = Twist(
b = Julia().material( mat1 ).scale(.4),
Vec2(10)
),
@charlieroberts
charlieroberts / march_9_hexagons.js
Created March 9, 2020 22:28
lots and lots of hexagons
// copy and paste into https://charlieroberts.github.io/marching/playground/
// select all and hit ctrl+enter
// turn quality to 'high' if you have a nice gfx card
quality = 'med'
size = .01/4
m = HexPrism( Vec2(size,size/16) ).material('green')
mirrors = []
count = 19