Last active
March 11, 2025 04:21
-
-
Save charlieroberts/4255c79e22a412ccc2034e29ea6e9d72 to your computer and use it in GitHub Desktop.
Small setup script to use screamer inside of hydra
This file contains 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
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 ) | |
screamer.initHydra = function() {} | |
screamer.init() | |
const canvas = document.createElement('canvas') | |
canvas.width = window.width | |
canvas.height = window.height | |
Marching.init( canvas ) | |
Marching.export( window ) | |
Marching.materials.__clearOnEmit = false | |
const prefix = `render = med lighting = () camera = (0 0 5) fog = (0 0 0 0) post = () background = (0 0 0)\n` | |
window.scream = code => screamer.run( prefix + code ) | |
scream.canvas = canvas |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment