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
| import numpy as np | |
| from OpenGL.GL import * | |
| WINDOW_LIBRARY = 'GLUT' # GLFW or GLUT | |
| TRY_FRAMEBUFFER = True | |
| GENERATE_TEXTURE_ID_PROBLEM = False # Follow this global variable to see the error in texture ID generation | |
| SIDE = 800 # window size | |
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
| var ac = new window.webkitAudioContext(); | |
| console.log( ac.currentTime ); | |
| var osc = ac.createOscillator(); | |
| osc.connect(ac.destination); | |
| osc.start(); | |
| osc.stop(); | |
| osc.start(); // InvalidStateError: Failed to execute 'start' on 'OscillatorNode': cannot call start more than once. | |
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
| void setup() { | |
| size(500, 500); | |
| noFill(); | |
| strokeWeight(3); | |
| strokeJoin(BEVEL); | |
| } | |
| float th1, th2, r, x, y, t; | |
| int N = 16; |
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
| // motion blur hack starts here | |
| int samplesPerFrame = 32; | |
| int numFrames = 48; | |
| float shutterAngle = 1.0; | |
| int[][] result; | |
| float time; | |
| void setup() { | |
| size(500, 500); |
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
| int samplesPerFrame = 32; | |
| int numFrames = 42; | |
| float shutterAngle = .8; | |
| int[][] result; | |
| float time; | |
| float d1, d2, th, pp = .7, t, tt; | |
| int N = 10, M = 9; |
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
| int[][] result; | |
| float time; | |
| void draw() { | |
| for (int i=0; i<width*height; i++) | |
| for (int a=0; a<3; a++) | |
| result[i][a] = 0; | |
| for (int sa=0; sa<samplesPerFrame; sa++) { | |
| time = map(frameCount-1 + sa*shutterAngle/samplesPerFrame, 0, numFrames, 0, 1); |
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
| int[][] result; | |
| float time; | |
| void draw() { | |
| for (int i=0; i<width*height; i++) | |
| for (int a=0; a<3; a++) | |
| result[i][a] = 0; | |
| for (int sa=0; sa<samplesPerFrame; sa++) { | |
| time = map(frameCount-1 + sa*shutterAngle/samplesPerFrame, 0, numFrames, 0, 1); |
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
| int samplesPerFrame = 32; | |
| int numFrames = 48; | |
| float shutterAngle = .8; | |
| int[][] result; | |
| float time; | |
| void draw() { | |
| for (int i=0; i<width*height; i++) | |
| for (int a=0; a<3; a++) | |
| result[i][a] = 0; |
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
| int samplesPerFrame = 32; | |
| int numFrames = 32; | |
| float shutterAngle = 1.0; | |
| int[][] result; | |
| void setup() { | |
| size(1000,1000,P3D); | |
| smooth(4); | |
| noStroke(); | |
| result = new int[width*height][3]; |