Skip to content

Instantly share code, notes, and snippets.

View hamoid's full-sized avatar

aBe hamoid

View GitHub Profile
@hamoid
hamoid / multiple_frame_rates.pde
Created May 3, 2013 12:36
In Processing, frameRate() sets the global frame rate. It does not allow to set independent frame rates for different objects. To achieve that, you can avoid drawing every object on every frame, effectively reducing the frame rate for some objects. You can learn more about the modulo operation (%), if statements and other concepts used in this p…
void setup() {
// Global frame rate is 30 fps
// 1 second = 30 frames
frameRate(30);
}
void draw() {
// Change the background once every 30 frames
// 30 frames is 1 second, so that means
// change the background at 1 fps
if(frameCount % 30 == 0) {
@hamoid
hamoid / youtubeCoveringPage.html
Last active December 16, 2015 22:39
A YouTube video below, a layer covering the whole page above
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Layer covering video</title>
<style type="text/css">
html, body {
padding: 0px;
margin:0px;
}
#overlay {