Skip to content

Instantly share code, notes, and snippets.

@lisawilliams
Last active December 14, 2015 00:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save lisawilliams/5000732 to your computer and use it in GitHub Desktop.
This is the (Processing) code for my #WhenIOwnTheGlobe offering. It involves a giant laser pointer and LOLCats.
// 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