-
Notifications
You must be signed in to change notification settings - Fork 12
/
FlipDot.pde
79 lines (66 loc) · 1.83 KB
/
FlipDot.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/**
* FlipDot Controller
*
* This Processing sketch is to control FlipDot panels from AlfaZeta.
* It uses a virtual display you can draw and animate on that then gets cast to your FlipDot display panels.
*
* If you don't have a FlipDot display you can still use this software as a FlipDot simulator. Just set `config_cast = false`
*
* @author Owen McAteer
* @url https://github.com/owenmcateer/FlipDots
* @socials https://x.com/motus_art
* @socials https://instagram.com/motus_art
*
* Required libraries
* - processing.net | Processing foundation
* - processing.serial | Processing foundation
* - websockets | Lasse Steenbock Vestergaard | (Only for realtime Crypo feed example)
*/
ClusterGrowth cluster_growth;
void setup() {
size(1080, 720, P2D);
frameRate(config_fps);
colorMode(RGB, 255, 255, 255, 1);
// Core setup functions
cast_setup();
config_setup();
stages_setup();
ui_setup();
// Scene setup
cluster_growth = new ClusterGrowth();
}
/**
* Draw tick
*/
void draw() {
background(59);
// 3D test
virtual3D.beginDraw();
virtual3D.background(0);
virtual3D.translate(virtual3D.width / 2, virtual3D.height / 2);
virtual3D.rotateX(frameCount / 20.0);
virtual3D.rotateY(frameCount / 20.0);
virtual3D.stroke(255);
virtual3D.strokeWeight(2);
virtual3D.noFill();
virtual3D.box(14);
virtual3D.endDraw();
// End 3D test
// Between beginDraw/endDraw you can draw whatever you want to virtualDisplay(PGraphics)
virtualDisplay.beginDraw();
virtualDisplay.background(0);
// Examples
//example_blips(); // Blips animation
example_anim(); // Animations
//cluster_growth.draw(); // Cluster growth
// Games
//games_tetris();
// End drawing
virtualDisplay.endDraw();
// Preview frame render
ui_render();
// Process frame
stage_process();
// Cast to display
cast_broadcast();
}