Commit 8b005336 authored by Lky's avatar Lky

update shortcuts for two channels

parent 70659675
......@@ -368,19 +368,19 @@ void main()
}
// note:: CSB goes from effect to negative (if mouseX from 1 to -1).
// HUE-VALUE matte
vec3 hsv_color = RGBToHSV(color);
vec3 tmp_color = color;
if (hsv_color.x > key_hue_threshold) {
if (hsv_color.z > key_value_threshold) {
tmp_color = color;
} else {
tmp_color = vec3(0,0,0);
}
} else {
tmp_color = vec3(0,0,0);
}
color = tmp_color;
// // HUE-VALUE matte
// vec3 hsv_color = RGBToHSV(color);
// vec3 tmp_color = color;
// if (hsv_color.x > key_hue_threshold) {
// if (hsv_color.z > key_value_threshold) {
// tmp_color = color;
// } else {
// tmp_color = vec3(0,0,0);
// }
// } else {
// tmp_color = vec3(0,0,0);
// }
// color = tmp_color;
// key_value_threshold
// key_hue_threshold;
......
......@@ -302,7 +302,7 @@ void ofApp::draw()
windowName += "key_hue = "+ ofToString(key_hue) +"; key_value = " + ofToString(key_value);
ofSetWindowTitle(windowName);
ofScale(1); // 3 is better
ofScale(3); // 3 is better
ofTranslate(0, 0); // x_pos_ch1
ofBackground(255);
......@@ -394,120 +394,230 @@ void ofApp::exit()
//--------------------------------------------------------------
void ofApp::keyPressed(int key){
switch (key) {
// SPEEDS
case '4':
w_fbo += 20;
x_pos_ch1 += 10;
x_pos_ch2 += 10;
x_sub -= 20;
main_fbo.allocate(w_fbo, MAIN_H, GL_RGB);
case 'u':
opBC_ch1 -= 0.1;
break;
case '3':
if (w_fbo > 20) {
w_fbo -= 20;
x_pos_ch1 -= 10;
x_pos_ch2 -= 10;
x_sub += 20;
}
main_fbo.allocate(w_fbo, MAIN_H, GL_RGB);
case 'o':
opBC_ch1 += 0.1;
break;
case 'q':
speed_ch1 += 0.2;
case 'j':
if (speed_ch1 == -1) {
speed_ch1 = -2;
}
else {
speed_ch1 = -1;
}
if (hap_ch1.isPaused()) {
hap_ch1.play();
}
hap_ch1.setSpeed(speed_ch1);
break;
case 'a':
speed_ch1 -= 0.2;
case 'k':
speed_ch1 = 0.1;
hap_ch1.setPaused(true);
break;
case 'l':
if (speed_ch1 == 1) {
speed_ch1 = 2;
}
else {
speed_ch1 = 1;
}
if (hap_ch1.isPaused()) {
hap_ch1.play();
}
hap_ch1.setSpeed(speed_ch1);
break;
case 'w':
speed_ch2 += 0.2;
hap_ch2.setSpeed(speed_ch2);
case '.':
x_pos_ch1 += 10;
break;
case ',':
x_pos_ch1 -= 10;
break;
case 's':
speed_ch2 -= 0.2;
hap_ch2.setSpeed(speed_ch2);
case 'q':
opBC_ch2-=0.1;
break;
case 'e':
speed_ch3 += 0.2;
hap_ch3.setSpeed(speed_ch3);
break;
case 'd':
speed_ch3 -= 0.2;
hap_ch3.setSpeed(speed_ch3);
break;
case 'x':
hap_ch1.setPosition(0);
hap_ch2.setPosition(0);
hap_ch3.setPosition(0);
opBC_ch2+=0.1;
break;
// Opacity Channels
case 'u':
if (hap_ch1.isPlaying()) {
hap_ch1.stop();
case 'a':
if (speed_ch2 == -1) {
speed_ch2 = -2;
}
else {
hap_ch1.play();
speed_ch2 = -1;
}
if (hap_ch2.isPaused()) {
hap_ch2.play();
}
hap_ch2.setSpeed(speed_ch2);
break;
case 'j':
speed_ch1 = -speed_ch1;
hap_ch1.setSpeed(-speed_ch1);
break;
case 'i':
opBC_ch2 += 0.1;
case 's':
speed_ch2 = 0.1;
hap_ch2.setPaused(true);
break;
case 'k':
opBC_ch2 -= 0.1;
case 'd':
if (speed_ch2 == 1) {
speed_ch2 = 2;
}
else {
speed_ch2 = 1;
}
if (hap_ch2.isPaused()) {
hap_ch2.play();
}
hap_ch2.setSpeed(speed_ch2);
break;
case 'o':
opBC_ch3 += 0.1;
case 'z':
x_pos_ch2 -= 10;
break;
case 'l':
opBC_ch3 -= 0.1;
case 'x':
x_pos_ch2 += 10;
break;
case 'h':
key_hue += 10;
case 'g':
w_fbo -= 10;
main_fbo.allocate(w_fbo, MAIN_H, GL_RGB);
break;
case 'H':
key_hue -= 10;
case 'h':
w_fbo += 10;
main_fbo.allocate(w_fbo, MAIN_H, GL_RGB);
break;
case 'v':
key_value += .1;
case 't':
w_sub -= 10;
break;
case 'V':
key_value -= .1;
case 'y':
w_sub += 10;
break;
//key_hue
case '[':
case 'b':
x_sub -= 10;
break;
case ']':
case 'n':
x_sub += 10;
break;
case '(':
w_sub -= 10;
break;
case ')':
w_sub += 10;
break;
case '\\':
case 'v':
sx_sub -= 10;
break;
case '|':
case 'm':
sx_sub += 10;
break;
case '{':
x_ch1 -= 10;
break;
case '}':
x_ch1 += 10;
break;
// SPEEDS
//case '4':
// w_fbo += 20;
// x_pos_ch1 += 10;
// x_pos_ch2 += 10;
// x_sub -= 20;
// main_fbo.allocate(w_fbo, MAIN_H, GL_RGB);
// break;
//case '3':
// if (w_fbo > 20) {
// w_fbo -= 20;
// x_pos_ch1 -= 10;
// x_pos_ch2 -= 10;
// x_sub += 20;
// }
// main_fbo.allocate(w_fbo, MAIN_H, GL_RGB);
// break;
//case 'q':
// speed_ch1 += 0.2;
// hap_ch1.setSpeed(speed_ch1);
// break;
//case 'a':
// speed_ch1 -= 0.2;
// hap_ch1.setSpeed(speed_ch1);
// break;
//case 'w':
// speed_ch2 += 0.2;
// hap_ch2.setSpeed(speed_ch2);
// break;
//case 's':
// speed_ch2 -= 0.2;
// hap_ch2.setSpeed(speed_ch2);
// break;
//case 'e':
// speed_ch3 += 0.2;
// hap_ch3.setSpeed(speed_ch3);
// break;
//case 'd':
// speed_ch3 -= 0.2;
// hap_ch3.setSpeed(speed_ch3);
// break;
//case 'x':
// hap_ch1.setPosition(0);
// hap_ch2.setPosition(0);
// hap_ch3.setPosition(0);
// break;
// // Opacity Channels
//case 'u':
// if (hap_ch1.isPlaying()) {
// hap_ch1.stop();
// }
// else {
// hap_ch1.play();
// }
// break;
//case 'j':
// speed_ch1 = -speed_ch1;
// hap_ch1.setSpeed(-speed_ch1);
// break;
//case 'i':
// opBC_ch2 += 0.1;
// break;
//case 'k':
// opBC_ch2 -= 0.1;
// break;
//case 'o':
// opBC_ch3 += 0.1;
// break;
//case 'l':
// opBC_ch3 -= 0.1;
// break;
//case 'h':
// key_hue += 10;
// break;
//case 'H':
// key_hue -= 10;
// break;
//case 'v':
// key_value += .1;
// break;
//case 'V':
// key_value -= .1;
// break;
// //key_hue
//case '[':
// x_sub -= 10;
// break;
//case ']':
// x_sub += 10;
// break;
//case '(':
// w_sub -= 10;
// break;
//case ')':
// w_sub += 10;
// break;
//case '\\':
// sx_sub -= 10;
// break;
//case '|':
// sx_sub += 10;
// break;
//case '{':
// x_ch1 -= 10;
// break;
//case '}':
// x_ch1 += 10;
// break;
// BLENDMODES AND MAIN OPACITY
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment