質問編集履歴
2
質問の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,732 +1,30 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
|
3
|
+
ご指摘があった為、修正し改めて質問をさせて頂きます。
|
3
4
|
|
5
|
+
Processingで木の枝にMinimライブラリを使って大きさを変化させた円を描画させるプログラムを作っています。
|
4
6
|
|
5
|
-
|
7
|
+
円の描画位置は下図のように木の枝の先に木の実がくっ付いている様に見えるイメージを考えています。
|
6
8
|
|
7
|
-
|
9
|
+
※ペイント3Dで編集した画像の為、該当のソースコードの実行画面ではありません。
|
10
|
+
|
11
|
+
![完成予想図](c03b5eeb3a17803142a6630dbf64c7ec.jpeg)
|
8
12
|
|
9
13
|
|
10
14
|
|
11
15
|
### 発生している問題・エラーメッセージ
|
12
16
|
|
13
|
-
|
14
|
-
|
15
|
-
```
|
16
|
-
|
17
|
-
円の描画
|
17
|
+
randomを使って指定範囲内で円の描画をさせていますが、この方法では四角形になってしまい木の枝以外の場所にも円が描画されてしまう。
|
18
|
-
|
19
|
-
![現状](624f8c0322bb0142fea37aadb323bbec.jpeg)
|
20
|
-
|
21
|
-
```
|
22
|
-
|
23
|
-
|
24
18
|
|
25
19
|
### 該当のソースコード
|
26
20
|
|
27
|
-
|
21
|
+
※該当のソースコードはMinimを抜いたサンプルプログラムです。
|
28
22
|
|
29
23
|
```processing
|
30
24
|
|
31
|
-
|
25
|
+
float x;
|
32
26
|
|
33
|
-
import ddf.minim.analysis.*;
|
34
|
-
|
35
|
-
import ddf.minim.effects.*;
|
36
|
-
|
37
|
-
import ddf.minim.signals.*;
|
38
|
-
|
39
|
-
import ddf.minim.spi.*;
|
40
|
-
|
41
|
-
import ddf.minim.ugens.*;
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
Minim minim;
|
46
|
-
|
47
|
-
//AudioInput in;
|
48
|
-
|
49
|
-
AudioPlayer player;
|
50
|
-
|
51
|
-
//float volumeIn;
|
52
|
-
|
53
|
-
int buffersize = 512;
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
class Note {
|
58
|
-
|
59
|
-
final float x;
|
60
|
-
|
61
|
-
final float y;
|
62
|
-
|
63
|
-
final float w;
|
64
|
-
|
65
|
-
final float h;
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
final float r;
|
70
|
-
|
71
|
-
final float r2;
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
final color col;//HSB, alpha
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
boolean isAlive = true;
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
Note(final float x, final float y, final float playerIn) {
|
84
|
-
|
85
|
-
this.x = random(700, 1210);
|
86
|
-
|
87
|
-
this.y = random(350, 450);
|
88
|
-
|
89
|
-
this.w = playerIn/2;
|
90
|
-
|
91
|
-
this.h = playerIn/2;
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
this.r = this.w / 2;
|
96
|
-
|
97
|
-
this.r2 = this.r * this.r;
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
this.col = color(random(360), 100, 100, 70);
|
102
|
-
|
103
|
-
}
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
void draw() {
|
108
|
-
|
109
|
-
colorMode(HSB, 360, 100, 100, 100);
|
110
|
-
|
111
|
-
noStroke();
|
112
|
-
|
113
|
-
fill(col);
|
114
|
-
|
115
|
-
ellipse(x, y, w, h);
|
116
|
-
|
117
|
-
}
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
void update() {
|
122
|
-
|
123
|
-
}
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
boolean isExpired() {
|
128
|
-
|
129
|
-
return !isAlive;
|
130
|
-
|
131
|
-
}
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
void toggle() {
|
136
|
-
|
137
|
-
isAlive = !isAlive;
|
138
|
-
|
139
|
-
}
|
140
|
-
|
141
|
-
}
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
abstract class Effect {
|
146
|
-
|
147
|
-
protected float time;
|
148
|
-
|
149
|
-
protected float t = 0;
|
150
|
-
|
151
|
-
final float dt = 1.0;
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
Effect() {
|
156
|
-
|
157
|
-
}
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
abstract void draw();
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
abstract void update();
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
void dec() {
|
170
|
-
|
171
|
-
time -= dt;
|
172
|
-
|
173
|
-
t += dt;
|
174
|
-
|
175
|
-
}
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
boolean isExpired() {
|
180
|
-
|
181
|
-
return time < 0;
|
182
|
-
|
183
|
-
}
|
184
|
-
|
185
|
-
}
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
abstract class MultiEffect extends Effect {
|
190
|
-
|
191
|
-
ArrayList<Effect> chidren = new ArrayList<Effect>();
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
MultiEffect() {
|
196
|
-
|
197
|
-
}
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
@Override
|
202
|
-
|
203
|
-
void draw() {
|
204
|
-
|
205
|
-
for (Effect eff : chidren) {
|
206
|
-
|
207
|
-
eff.draw();
|
208
|
-
|
209
|
-
}
|
210
|
-
|
211
|
-
}
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
@Override
|
216
|
-
|
217
|
-
void update() {
|
218
|
-
|
219
|
-
for (Effect eff : chidren) {
|
220
|
-
|
221
|
-
eff.update();
|
222
|
-
|
223
|
-
}
|
224
|
-
|
225
|
-
}
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
@Override
|
230
|
-
|
231
|
-
boolean isExpired() {
|
232
|
-
|
233
|
-
for (Effect eff : chidren) {
|
234
|
-
|
235
|
-
if (!eff.isExpired()) return false;
|
236
|
-
|
237
|
-
}
|
238
|
-
|
239
|
-
return true;
|
240
|
-
|
241
|
-
}
|
242
|
-
|
243
|
-
}
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
class Bakuhatu extends Effect {
|
248
|
-
|
249
|
-
final float x;
|
250
|
-
|
251
|
-
final float y;
|
252
|
-
|
253
|
-
float r;
|
254
|
-
|
255
|
-
float dr = 1;
|
256
|
-
|
257
|
-
final float ddr = 0.5;
|
258
|
-
|
259
|
-
//color col;
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
final int R, G, B;
|
264
|
-
|
265
|
-
int alpha;
|
266
|
-
|
267
|
-
int da = 0;
|
268
|
-
|
269
|
-
final int dda = 1;
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
Bakuhatu(final float x, final float y, final float r, final color col, final float time) {
|
274
|
-
|
275
|
-
this.x = x;
|
276
|
-
|
277
|
-
this.y = y;
|
278
|
-
|
279
|
-
this.r = r;
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
final int mask = 0xFF;
|
284
|
-
|
285
|
-
alpha = (col>>24) & mask;
|
286
|
-
|
287
|
-
alpha /= 2;
|
288
|
-
|
289
|
-
R = (col>>16) & mask;
|
290
|
-
|
291
|
-
G = (col>>8) & mask;
|
292
|
-
|
293
|
-
B = col & mask;
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
this.time = time;
|
298
|
-
|
299
|
-
}
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
@Override
|
304
|
-
|
305
|
-
void draw() {
|
306
|
-
|
307
|
-
noStroke();
|
308
|
-
|
309
|
-
//fill(col);
|
310
|
-
|
311
|
-
colorMode(RGB);
|
312
|
-
|
313
|
-
fill(R, G, B, alpha);
|
314
|
-
|
315
|
-
ellipse(x, y, 2*r, 2*r);
|
316
|
-
|
317
|
-
}
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
@Override
|
322
|
-
|
323
|
-
void update() {
|
324
|
-
|
325
|
-
dec();
|
326
|
-
|
327
|
-
r += dr;
|
328
|
-
|
329
|
-
dr += ddr;
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
alpha -= da;
|
334
|
-
|
335
|
-
da += dda;
|
336
|
-
|
337
|
-
}
|
338
|
-
|
339
|
-
}
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
final float g = 0.2;
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
class Hinoko extends Effect {
|
348
|
-
|
349
|
-
float x;
|
350
|
-
|
351
|
-
|
27
|
+
float y;
|
352
|
-
|
353
|
-
final float r = 2;
|
354
|
-
|
355
|
-
final float v0 = 5;
|
356
|
-
|
357
|
-
float vx;
|
358
|
-
|
359
|
-
float vy;
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
final float theta;
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
final color col;
|
368
|
-
|
369
|
-
int R, G, B;
|
370
|
-
|
371
|
-
int alpha;
|
372
|
-
|
373
|
-
float da = 1;
|
374
|
-
|
375
|
-
final float dda = 0.05;
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
//final float start;
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
float drx, dry;
|
384
|
-
|
385
|
-
float ddrx, ddry;
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
Hinoko(final float x, final float y, final float r, final color col, final float theta, final float time) {
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
this.x = x;
|
394
|
-
|
395
|
-
this.y = y;
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
this.vx = v0 * cos(theta);
|
400
|
-
|
401
|
-
this.vy = v0 * sin(theta);
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
this.col = col;
|
406
|
-
|
407
|
-
//this.col = color(h,s,b,alpha);
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
final int mask = 0xFF;
|
412
|
-
|
413
|
-
alpha = (col>>24) & mask;
|
414
|
-
|
415
|
-
//alpha /= 2;
|
416
|
-
|
417
|
-
R = (col>>16) & mask;
|
418
|
-
|
419
|
-
G = (col>>8) & mask;
|
420
|
-
|
421
|
-
B = col & mask;
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
this.drx = 0.5;
|
426
|
-
|
427
|
-
this.dry = 0.05;
|
428
|
-
|
429
|
-
this.ddrx = 0.5;
|
430
|
-
|
431
|
-
this.ddry = 0.05;
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
this.time = time;
|
436
|
-
|
437
|
-
//this.start = time;
|
438
|
-
|
439
|
-
this.theta = theta;
|
440
|
-
|
441
|
-
}
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
@Override
|
446
|
-
|
447
|
-
void draw() {
|
448
|
-
|
449
|
-
noStroke();
|
450
|
-
|
451
|
-
colorMode(RGB);
|
452
|
-
|
453
|
-
fill(R, G, B, alpha);
|
454
|
-
|
455
|
-
//fill(col);
|
456
|
-
|
457
|
-
ellipse(x, y, r, r);
|
458
|
-
|
459
|
-
}
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
@Override
|
464
|
-
|
465
|
-
void update() {
|
466
|
-
|
467
|
-
dec();
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
alpha -= da;
|
472
|
-
|
473
|
-
da += dda;
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
x += vx;
|
478
|
-
|
479
|
-
y += vy;
|
480
|
-
|
481
|
-
y += g*t;
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
drx += ddrx;
|
486
|
-
|
487
|
-
dry += ddry;
|
488
|
-
|
489
|
-
}
|
490
|
-
|
491
|
-
}
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
class Hanabi extends MultiEffect {
|
496
|
-
|
497
|
-
Hanabi(final float x, final float y, final float r, final color col) {
|
498
|
-
|
499
|
-
super();
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
final float timeB = 30;
|
504
|
-
|
505
|
-
chidren.add(new Bakuhatu(x, y, r, col, timeB));
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
final float timeH = 50;
|
510
|
-
|
511
|
-
final int max = 32;
|
512
|
-
|
513
|
-
final float dtheta = TWO_PI / max;
|
514
|
-
|
515
|
-
for (int i=0; i<max; i++) {
|
516
|
-
|
517
|
-
chidren.add(new Hinoko(x, y, r, col, dtheta*i, timeH));
|
518
|
-
|
519
|
-
}
|
520
|
-
|
521
|
-
}
|
522
|
-
|
523
|
-
}
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
class Effects extends ArrayList<Effect> {
|
528
|
-
|
529
|
-
Effects() {
|
530
|
-
|
531
|
-
//do nothing
|
532
|
-
|
533
|
-
}
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
void add(Effects temp) {
|
538
|
-
|
539
|
-
this.addAll(temp);
|
540
|
-
|
541
|
-
}
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
void draw() {
|
546
|
-
|
547
|
-
for (Effect eff : this) {
|
548
|
-
|
549
|
-
eff.draw();
|
550
|
-
|
551
|
-
}
|
552
|
-
|
553
|
-
}
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
void update() {
|
558
|
-
|
559
|
-
ArrayList<Effect> temp = new ArrayList<Effect>();
|
560
|
-
|
561
|
-
for (Effect eff : this) {
|
562
|
-
|
563
|
-
eff.update();
|
564
|
-
|
565
|
-
if (!eff.isExpired()) temp.add(eff);
|
566
|
-
|
567
|
-
}
|
568
|
-
|
569
|
-
this.clear();
|
570
|
-
|
571
|
-
this.addAll(temp);
|
572
|
-
|
573
|
-
}
|
574
|
-
|
575
|
-
}
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
class NoteController {
|
580
|
-
|
581
|
-
ArrayList<Note> notes = new ArrayList<Note>();
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
final float margin = 100;
|
586
|
-
|
587
|
-
final float xmin = margin;
|
588
|
-
|
589
|
-
final float xmax = width-margin;
|
590
|
-
|
591
|
-
final float ymin = margin;
|
592
|
-
|
593
|
-
final float ymax = height-margin;
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
NoteController() {
|
598
|
-
|
599
|
-
//
|
600
|
-
|
601
|
-
}
|
602
|
-
|
603
|
-
//円の制御
|
604
|
-
|
605
|
-
void add(final float playerIn) {
|
606
|
-
|
607
|
-
if (notes.size() > 100) return;//check
|
608
|
-
|
609
|
-
if (playerIn < 20) return;
|
610
|
-
|
611
|
-
if (frameCount % 20 != 0) return;
|
612
|
-
|
613
|
-
//if (frameCount % (int)random(10, 40) != 0) return;
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
final float x = random(xmin, xmax);
|
618
|
-
|
619
|
-
final float y = random(ymin, ymax);
|
620
|
-
|
621
|
-
notes.add(new Note(x, y, playerIn));
|
622
|
-
|
623
|
-
}
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
void draw() {
|
628
|
-
|
629
|
-
for (Note note : notes) {
|
630
|
-
|
631
|
-
note.draw();
|
632
|
-
|
633
|
-
}
|
634
|
-
|
635
|
-
}
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
ArrayList<Note> update() {
|
640
|
-
|
641
|
-
ArrayList<Note> next = new ArrayList<Note>();
|
642
|
-
|
643
|
-
ArrayList<Note> del = new ArrayList<Note>();
|
644
|
-
|
645
|
-
for (Note note : notes) {
|
646
|
-
|
647
|
-
note.update();
|
648
|
-
|
649
|
-
if (note.isExpired()) {
|
650
|
-
|
651
|
-
del.add(note);
|
652
|
-
|
653
|
-
} else {
|
654
|
-
|
655
|
-
next.add(note);
|
656
|
-
|
657
|
-
}
|
658
|
-
|
659
|
-
}
|
660
|
-
|
661
|
-
notes.clear();
|
662
|
-
|
663
|
-
notes.addAll(next);
|
664
|
-
|
665
|
-
return del;
|
666
|
-
|
667
|
-
}
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
//真偽を使って判断
|
672
|
-
|
673
|
-
boolean isHit(final Note note) {
|
674
|
-
|
675
|
-
return true;
|
676
|
-
|
677
|
-
}
|
678
|
-
|
679
|
-
//全指定
|
680
|
-
|
681
|
-
void mouseClicked() {
|
682
|
-
|
683
|
-
for (Note note : notes) {
|
684
|
-
|
685
|
-
note.toggle();
|
686
|
-
|
687
|
-
}
|
688
|
-
|
689
|
-
}
|
690
|
-
|
691
|
-
}
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
class Converter {
|
696
|
-
|
697
|
-
Effects makeHanabis(ArrayList<Note> notes) {
|
698
|
-
|
699
|
-
Effects temp = new Effects();
|
700
|
-
|
701
|
-
for (Note note : notes) {
|
702
|
-
|
703
|
-
temp.add(makeHanabi(note));
|
704
|
-
|
705
|
-
}
|
706
|
-
|
707
|
-
return temp;
|
708
|
-
|
709
|
-
}
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
Hanabi makeHanabi(Note note) {
|
714
|
-
|
715
|
-
Hanabi temp = new Hanabi(note.x, note.y, note.r, note.col);
|
716
|
-
|
717
|
-
return temp;
|
718
|
-
|
719
|
-
}
|
720
|
-
|
721
|
-
}
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
NoteController controller;
|
726
|
-
|
727
|
-
Effects effects;
|
728
|
-
|
729
|
-
Converter converter;
|
730
28
|
|
731
29
|
|
732
30
|
|
@@ -734,37 +32,17 @@
|
|
734
32
|
|
735
33
|
fullScreen();
|
736
34
|
|
35
|
+
smooth();
|
36
|
+
|
737
|
-
frameRate(
|
37
|
+
frameRate(10);
|
38
|
+
|
39
|
+
colorMode(HSB, 360, 100, 100, 200);
|
738
40
|
|
739
41
|
|
740
42
|
|
741
|
-
|
43
|
+
Tree(30, width/2, height, PI, width/6); //木の太さ・描画位置,PI=π 180°
|
742
|
-
|
743
|
-
fill(#8B7250);
|
744
|
-
|
745
|
-
rect(0, 1030, 2000, 50); */
|
746
44
|
|
747
45
|
|
748
|
-
|
749
|
-
colorMode(HSB, 360, 100, 100, 100);
|
750
|
-
|
751
|
-
controller = new NoteController();
|
752
|
-
|
753
|
-
effects = new Effects();
|
754
|
-
|
755
|
-
converter = new Converter();
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
minim = new Minim(this);
|
760
|
-
|
761
|
-
//in = minim.getLineIn(Minim.STEREO,buffersize);
|
762
|
-
|
763
|
-
final String fn = "Mountain.mp3";
|
764
|
-
|
765
|
-
player = minim.loadFile(fn);
|
766
|
-
|
767
|
-
player.loop();
|
768
46
|
|
769
47
|
}
|
770
48
|
|
@@ -772,37 +50,21 @@
|
|
772
50
|
|
773
51
|
void draw() {
|
774
52
|
|
53
|
+
x = random(650, 1250); //横
|
54
|
+
|
55
|
+
y = random(200, 300); //縦
|
56
|
+
|
775
|
-
|
57
|
+
noStroke();
|
58
|
+
|
59
|
+
fill(random(255), random(255), random(255), 50);
|
60
|
+
|
61
|
+
ellipse(x,y,10,10);
|
776
62
|
|
777
63
|
|
778
64
|
|
779
|
-
|
65
|
+
fill(#959592);
|
780
66
|
|
781
|
-
noStroke();
|
782
|
-
|
783
|
-
fill(#8B7250);
|
784
|
-
|
785
|
-
rect(0, 1030, 2000, 50);
|
67
|
+
rect(0, 1030, 2000, 50);
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
// volumeIn = in.mix.level()*200;
|
790
|
-
|
791
|
-
final float playerIn = player.mix.level()*150;
|
792
|
-
|
793
|
-
controller.add(playerIn);
|
794
|
-
|
795
|
-
controller.draw();
|
796
|
-
|
797
|
-
ArrayList<Note> temp = controller.update();
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
effects.add(converter.makeHanabis(temp));
|
802
|
-
|
803
|
-
effects.draw();
|
804
|
-
|
805
|
-
effects.update();
|
806
68
|
|
807
69
|
}
|
808
70
|
|
@@ -820,7 +82,7 @@
|
|
820
82
|
|
821
83
|
strokeWeight(strokeWeight); //線の輪郭線の太さ
|
822
84
|
|
823
|
-
stroke(
|
85
|
+
stroke(#64482A); //線の色
|
824
86
|
|
825
87
|
line(0, 0, 0, length); //線の描画,配列の長さ
|
826
88
|
|
@@ -828,49 +90,11 @@
|
|
828
90
|
|
829
91
|
if (strokeWeight<2)return;
|
830
92
|
|
831
|
-
//if (random(0, 4)>3 && strokeWeight<3)return;
|
832
|
-
|
833
|
-
if (x%5>3 && strokeWeight<3)return;
|
93
|
+
if (x%5>3 && strokeWeight<3)return;
|
834
94
|
|
835
95
|
Tree(strokeWeight*2/3, x-sin(rotate)*length, y+cos(rotate)*length, rotate-PI/10, length*2/3);
|
836
96
|
|
837
97
|
Tree(strokeWeight*2/3, x-sin(rotate)*length, y+cos(rotate)*length, rotate+PI/10, length*2/3);
|
838
|
-
|
839
|
-
}
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
void keyPressed() {
|
844
|
-
|
845
|
-
if (key == 's') { //音楽ストップ
|
846
|
-
|
847
|
-
player.pause();
|
848
|
-
|
849
|
-
} else if (key == 'r') { //音楽リスタート
|
850
|
-
|
851
|
-
player.rewind();
|
852
|
-
|
853
|
-
player.play();
|
854
|
-
|
855
|
-
}
|
856
|
-
|
857
|
-
}
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
void stop() {
|
862
|
-
|
863
|
-
minim.stop();
|
864
|
-
|
865
|
-
super.stop();
|
866
|
-
|
867
|
-
}
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
void mouseClicked() {
|
872
|
-
|
873
|
-
controller.mouseClicked();
|
874
98
|
|
875
99
|
}
|
876
100
|
|
1
現時点の実行画面の画像の挿入が上手く行かない。
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,9 +14,9 @@
|
|
14
14
|
|
15
15
|
```
|
16
16
|
|
17
|
-
円の描画位置の指定が四角形の方法しか知らず、木の輪郭(扇形)に合うような描画位置の指定方法が分かりません。
|
17
|
+
円の描画位置の指定が四角形の方法しか知らず、木の輪郭(扇形)に合うような描画位置の指定方法が分かりません。
|
18
|
+
|
18
|
-
|
19
|
+
![現状](624f8c0322bb0142fea37aadb323bbec.jpeg)
|
19
|
-
|
20
20
|
|
21
21
|
```
|
22
22
|
|