float luma(vec3 color) {
return dot(color, vec3(0.299, 0.587, 0.114));
}
float luma(vec4 color) {
return dot(color.rgb, vec3(0.299, 0.587, 0.114));
}
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>KeepAlive</key> | |
<dict> | |
<key>SuccessfulExit</exit> | |
<true/> | |
</dict> | |
<key>Label</key> |
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
// White NanoKontrol midi Map | |
const int NANO_KONTROL_SC1_SLIDER_1 = 2; | |
const int NANO_KONTROL_SC1_SLIDER_2 = 3; | |
const int NANO_KONTROL_SC1_SLIDER_3 = 4; | |
const int NANO_KONTROL_SC1_SLIDER_4 = 5; | |
const int NANO_KONTROL_SC1_SLIDER_5 = 6; | |
const int NANO_KONTROL_SC1_SLIDER_6 = 8; | |
const int NANO_KONTROL_SC1_SLIDER_7 = 9; | |
const int NANO_KONTROL_SC1_SLIDER_8 = 12; |
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
textureRes = (int)sqrt((float)numParticles); | |
numParticles = textureRes * textureRes; | |
float * pos = new float[numParticles*3]; | |
for (int x = 0; x < textureRes; x++){ | |
for (int y = 0; y < textureRes; y++){ | |
int i = textureRes * y + x; | |
pos[i*3 + 0] = ofMap(x + 1, 0, textureRes + 1, 0, 1); //x*offset; | |
pos[i*3 + 1] = ofMap(y + 1, 0, textureRes + 1, 0, 1); //y*offset; |
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
#include "testApp.h" | |
const string SHADER_VS = " \ | |
uniform mat4 projection_matrix; \ | |
uniform mat4 view_matrix; \ | |
attribute vec4 pos; \ | |
attribute vec2 tex; \ | |
varying vec2 vtex; \ | |
\ | |
void main() { \ |
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
drag.set(particles[i]->vel.getNormalized());//copy of the velocity vectors direction | |
float speed = particles[i]->vel.length(); //get the vectors length in order to: | |
drag.scale(c*speed); //multiply it by coeficient | |
particles[i]->applyForce(drag); |
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
PVector drag = p.vel.get(); //get a copy of velocity | |
drag.normalize(); //normalize it | |
float c = -0.005; //coeficient | |
float speed = p.vel.mag(); //modulo de la velocidad | |
drag.mult(c*speed*speed); | |
p.applyForce(drag); |
NewerOlder