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
| //Animated gif with Ted Davis help | |
| await loadScript("https://cdn.jsdelivr.net/npm/p5.glitch@latest/p5.glitch.js") //loads p5glitch library in Hydra | |
| let glitch; | |
| p = new P5() //comment this line after using it once | |
| glitch = new Glitch(p); | |
| img = p.loadImage('https://media3.giphy.com/media/v1.Y2lkPTc5MGI3NjExYzA0ZmE1ZDNmNTU1NzJkNDg3MWFmZWViZWVkOTk1OTEzMmQ5OWQ4OSZjdD1z/3o6fJ3xFENBRxVFvUc/giphy.gif', function(im) { | |
| }); |
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
| /* | |
| _hydra_texture // cc ojack.xyz + teddavis.org 2021 | |
| edit hydra code within // hydraSandbox tags for changes w/o recompiling p5! | |
| cheatsheets: https://ojack.xyz/hydra-functions/ + https://hydra-book.naotohieda.com/ | |
| */ | |
| let img; | |
| let genie; | |
| function preload() { | |
| img = loadImage('https://raw.githubusercontent.com/flordefuego/test_to_upload_stuff/main/genie.png'); | |
| genie = loadModel('https://raw.githubusercontent.com/flordefuego/test_to_upload_stuff/main/genie.obj') |
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
| p = new P5() | |
| p.draw= ()=>{ | |
| p.noStroke(); | |
| p.rect(p.width/2,p.height/2,100) | |
| } | |
| p.hide(); | |
| s0.init({src:p.canvas}) |
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
| p = new P5({mode: 'WEBGL'}) | |
| p.draw= ()=>{ | |
| p.background(0,0,0,0); | |
| p.orbitControl(5); | |
| p.fill(255); | |
| p.torus(150,15,5); | |
| } | |
| p.hide(); |
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
| //p5 sketch from https://editor.p5js.org/remarkability/sketches/1D90zhu4a | |
| p = new P5() | |
| let permissionGranted = false; | |
| let cx, cy; | |
| cx = p.width/2; | |
| cy = p.height/2; | |
| // DeviceOrientationEvent, DeviceMotionEvent | |
| if (typeof(DeviceOrientationEvent) !== 'undefined' && typeof(DeviceOrientationEvent.requestPermission) === 'function') { | |
| // ios 13 device | |
| DeviceOrientationEvent.requestPermission() |
NewerOlder