Skip to content

Commit a476ce3

Browse files
author
Sang Won Lee
committed
disintegrate/integrate/ alpha #10
the three more commands are added. `/disintegrate` `/integrate` `/alpha` (with region)
1 parent 9d25df4 commit a476ce3

File tree

4 files changed

+294
-65
lines changed

4 files changed

+294
-65
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636
- `/fontcolor [greyscale]`: the font color in grayscale [0,255]
3737
- `/fontscale [fontsize]`: the font size - numeric value 0 is default size.
3838
- `/alpha [alphavalue]`: set alpha value of all text [0,255] 0 being transparent.
39-
- `/fadeindelay [delay]`: delay value for text addition. if positive value, the text will fade in slowly. [0,-]
39+
- `/alpha [alphavalue] [start line] [start ch] [end line] [end ch]`: set alpha value of text in the specified region, [0,255] 0 being transparent.
40+
- `/fadeindelay [delay]`: delay value for text addition. if positive value, the text will fade in slowly. [0,-]
4041
- `/fontscale [fontsize]`: the font size - numeric value 0 is default size.
42+
- `/disintegrate [start line] [start ch] [end line] [end ch]`: any letter within the specified region will be dispersed to a random direction.
43+
- `/integrate [start line] [start ch] [end line] [end ch]`: any letters dispersed by `/disintegrate` within the specified region will be reset.
4144
- `/remove [start line] [start ch] [end line] [end ch]`
4245
- reference

osc-side/puredata/osc-web.pd

+79-57
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,104 @@
1-
#N canvas 1962 23 597 1035 10;
1+
#N canvas 2165 37 1376 1035 10;
22
#X obj 434 451 import mrpeach;
3-
#X obj 247 354 packOSC;
43
#X obj 247 444 udpsend;
54
#X msg 287 409 disconnect;
6-
#X msg 688 114 /camrotate \$1 \$2 \$3;
5+
#X msg 808 114 /camrotate \$1 \$2 \$3;
76
#X msg 28 115 /camtranslate \$1 \$2 \$3;
8-
#X msg 522 115 /color \$1;
7+
#X msg 642 115 /color \$1;
98
#X msg 255 115 /fontcolor \$1;
109
#X msg 355 114 /rotation \$1;
1110
#X msg 69 310 /clear;
1211
#X msg 178 114 /add test;
13-
#X msg 379 313 /add \\\\'a\\\\'e\\\\'o\\\\'i\\\\'u\\\\'n\\\\'A\\\\'E\\\\'I\\\\'O\\\\'U\\\\'N
12+
#X msg 499 313 /add \\\\'a\\\\'e\\\\'o\\\\'i\\\\'u\\\\'n\\\\'A\\\\'E\\\\'I\\\\'O\\\\'U\\\\'N
1413
;
1514
#X msg 405 282 /add test\\\\ntest;
1615
#X msg 287 383 connect 127.0.0.1 3333;
1716
#X floatatom 256 81 5 0 0 0 - - -;
1817
#X msg 443 115 /alpha \$1;
1918
#X floatatom 356 79 5 0 0 0 - - -;
20-
#X floatatom 598 70 5 0 0 0 - - -;
19+
#X floatatom 718 70 5 0 0 0 - - -;
2120
#X floatatom 27 31 5 0 0 0 - - -;
2221
#X floatatom 67 30 5 0 0 0 - - -;
2322
#X floatatom 112 29 5 0 0 0 - - -;
2423
#X obj 28 91 pack \$1 \$2 \$3;
2524
#X msg 74 54 bang;
2625
#X msg 116 55 bang;
27-
#X floatatom 521 72 5 0 0 0 - - -;
28-
#X floatatom 685 25 5 0 0 0 - - -;
29-
#X floatatom 725 24 5 0 0 0 - - -;
30-
#X floatatom 770 23 5 0 0 0 - - -;
31-
#X obj 686 85 pack \$1 \$2 \$3;
32-
#X msg 732 48 bang;
33-
#X msg 774 49 bang;
34-
#X msg 598 115 /distort \$1;
35-
#X floatatom 824 68 5 0 0 0 - - -;
36-
#X msg 826 112 /fontscale \$1;
37-
#X floatatom 926 66 5 0 0 0 - - -;
38-
#X msg 926 113 /z \$1;
39-
#X floatatom 445 78 5 0 0 0 - - -;
40-
#X floatatom 988 66 5 0 0 0 - - -;
41-
#X msg 988 113 /fadeindelay \$1;
42-
#X connect 1 0 2 0;
43-
#X connect 3 0 2 0;
44-
#X connect 4 0 1 0;
45-
#X connect 5 0 1 0;
46-
#X connect 6 0 1 0;
47-
#X connect 7 0 1 0;
48-
#X connect 8 0 1 0;
49-
#X connect 9 0 1 0;
50-
#X connect 10 0 1 0;
51-
#X connect 11 0 1 0;
26+
#X floatatom 641 72 5 0 0 0 - - -;
27+
#X floatatom 729 29 5 0 0 0 - - -;
28+
#X floatatom 769 28 5 0 0 0 - - -;
29+
#X floatatom 814 27 5 0 0 0 - - -;
30+
#X obj 806 85 pack \$1 \$2 \$3;
31+
#X msg 852 48 bang;
32+
#X msg 894 49 bang;
33+
#X msg 718 115 /distort \$1;
34+
#X floatatom 944 68 5 0 0 0 - - -;
35+
#X msg 946 112 /fontscale \$1;
36+
#X floatatom 1046 66 5 0 0 0 - - -;
37+
#X msg 1046 113 /z \$1;
38+
#X floatatom 443 80 5 0 0 0 - - -;
39+
#X floatatom 1108 66 5 0 0 0 - - -;
40+
#X msg 1108 113 /fadeindelay \$1;
41+
#X msg 1185 108 /disintegrate 0 0 1 3;
42+
#X obj 247 354 packOSC;
43+
#X obj 1117 335 packOSC;
44+
#X msg 1184 57 /disintegrate 0 2 2 3;
45+
#X floatatom 1190 130 5 0 0 0 - - -;
46+
#X msg 1190 157 /disintegrateSpeed \$1;
47+
#X msg 1185 83 /disintegrate 0 0 0 9;
48+
#X msg 1193 245 /integrate 0 0 1 3;
49+
#X msg 1193 220 /integrate 0 0 0 3;
50+
#X msg 1192 194 /integrate 0 2 2 1;
51+
#X floatatom 515 81 5 0 0 0 - - -;
52+
#X msg 515 116 /alpha \$1 0 0 0 9;
53+
#X connect 2 0 1 0;
54+
#X connect 3 0 39 0;
55+
#X connect 4 0 39 0;
56+
#X connect 5 0 39 0;
57+
#X connect 6 0 39 0;
58+
#X connect 7 0 39 0;
59+
#X connect 8 0 39 0;
60+
#X connect 9 0 39 0;
61+
#X connect 10 0 39 0;
62+
#X connect 11 0 39 0;
5263
#X connect 12 0 1 0;
53-
#X connect 13 0 2 0;
54-
#X connect 14 0 7 0;
55-
#X connect 15 0 1 0;
56-
#X connect 16 0 8 0;
57-
#X connect 17 0 31 0;
64+
#X connect 13 0 6 0;
65+
#X connect 14 0 39 0;
66+
#X connect 15 0 7 0;
67+
#X connect 16 0 30 0;
68+
#X connect 17 0 20 0;
69+
#X connect 18 0 20 1;
5870
#X connect 18 0 21 0;
59-
#X connect 19 0 21 1;
71+
#X connect 19 0 20 2;
6072
#X connect 19 0 22 0;
61-
#X connect 20 0 21 2;
62-
#X connect 20 0 23 0;
63-
#X connect 21 0 5 0;
64-
#X connect 22 0 21 0;
65-
#X connect 23 0 21 0;
66-
#X connect 24 0 6 0;
73+
#X connect 20 0 4 0;
74+
#X connect 21 0 20 0;
75+
#X connect 22 0 20 0;
76+
#X connect 23 0 5 0;
77+
#X connect 24 0 27 0;
78+
#X connect 25 0 27 1;
6779
#X connect 25 0 28 0;
68-
#X connect 26 0 28 1;
80+
#X connect 26 0 27 2;
6981
#X connect 26 0 29 0;
70-
#X connect 27 0 28 2;
71-
#X connect 27 0 30 0;
72-
#X connect 28 0 4 0;
73-
#X connect 29 0 28 0;
74-
#X connect 30 0 28 0;
75-
#X connect 31 0 1 0;
76-
#X connect 32 0 33 0;
77-
#X connect 33 0 1 0;
78-
#X connect 34 0 35 0;
79-
#X connect 35 0 1 0;
80-
#X connect 36 0 15 0;
81-
#X connect 37 0 38 0;
82-
#X connect 38 0 1 0;
82+
#X connect 27 0 3 0;
83+
#X connect 28 0 27 0;
84+
#X connect 29 0 27 0;
85+
#X connect 30 0 39 0;
86+
#X connect 31 0 32 0;
87+
#X connect 32 0 40 0;
88+
#X connect 33 0 34 0;
89+
#X connect 34 0 40 0;
90+
#X connect 35 0 14 0;
91+
#X connect 36 0 37 0;
92+
#X connect 37 0 40 0;
93+
#X connect 38 0 40 0;
94+
#X connect 39 0 1 0;
95+
#X connect 40 0 1 0;
96+
#X connect 41 0 40 0;
97+
#X connect 42 0 43 0;
98+
#X connect 43 0 40 0;
99+
#X connect 44 0 40 0;
100+
#X connect 45 0 40 0;
101+
#X connect 46 0 40 0;
102+
#X connect 47 0 40 0;
103+
#X connect 48 0 49 0;
104+
#X connect 49 0 39 0;

public/index.html

+10-3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@
9999
// varying float index;
100100
attribute float strIndex;
101101
attribute float appearTime;
102+
attribute float disintegrateTime;
103+
attribute float disintegrateXSpeed;
104+
attribute float disintegrateYSpeed;
105+
attribute float letterAlpha;
102106
varying float vAlpha;
103107

104108
uniform float interval;
@@ -111,12 +115,15 @@
111115
vec4 fpos = vec4(position,1.0);
112116
// fpos.x += -35.0;
113117
vAlpha = min((time - appearTime+fadeInDelay)/fadeInDelay,1.0);
118+
vAlpha = min(vAlpha,letterAlpha);
114119
float xCoord = position.x/rightMostXCoord;
115120
fpos.y = fpos.y + timeDomain[int(xCoord*128.0)];
116121
float speed = 1.0-exp(-time*0.003);
117-
fpos.x += ((sin(strIndex+time*2.0)))*(rotation) * 1.0;
118-
fpos.z += ((sin(strIndex+time*2.0)))*(rotation) * 1.0;
119-
fpos.y += ((cos(strIndex+time*2.0)))*(rotation)* 1.0;
122+
fpos.x += sin(strIndex+time*2.0)*rotation ;
123+
fpos.z += sin(strIndex+time*2.0)*rotation ;
124+
fpos.y += (time - disintegrateTime)*disintegrateYSpeed;
125+
fpos.x += (time - disintegrateTime)*disintegrateXSpeed;
126+
120127
vec4 mvPosition = modelViewMatrix * fpos;
121128
// mvPosition.y += 1.0*sin(volume*0.5+mvPosition.x/25.0)*(rotation*10.0);
122129
// mvPosition.x -= 1.0*cos(volume*0.5+mvPosition.y/25.0)*(rotation*10.0);

0 commit comments

Comments
 (0)