This is the (Processing) code for my #WhenIOwnTheGlobe offering. It involves a giant laser pointer and LOLCats.
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
// I couldn't quite get processing.js to run for this one, which is why it's an animated gif | |
//<script type="text/javascript" src="processing.min_.js"> | |
//</script> | |
//<script type="text/processing" data-processing-target="processing-canvas"> | |
float step = 0.0f; | |
// The next line is needed if running in JavaScript Mode with Processing.js | |
// @pjs preload="bosglobe.jpg"; | |
PImage bg; | |
int y; | |
void setup() { | |
size(460, 336); | |
bg = loadImage("bosglobe.jpg"); | |
} | |
void draw() { | |
background(bg); | |
fill( 255, 0, 0 ); | |
// reset step value so it starts from the begining | |
if ( step >= 1.0f ) { | |
step = 0.0f; | |
} | |
float x = bezierPoint(85, 10, 190, 320, step); | |
float y = bezierPoint(20, 300, 190, 180, step); | |
ellipse(x, y, 9, 9); | |
// Change this to adjust the speed | |
step += 0.01f; | |
} | |
//</script> | |
//<canvas id="processing-canvas"> </canvas> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment