Skip to content

Commit 6d9049f

Browse files
committed
Update
1 parent 75e0a5c commit 6d9049f

File tree

4 files changed

+174
-0
lines changed

4 files changed

+174
-0
lines changed
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
@name "Ruskeths E3 Clock";
2+
3+
server {
4+
entity gate = system.getEntity();
5+
6+
hologram bg = hololib.create("models/sprops/geometry/t_fdisc_12.mdl");
7+
bg.setPos(gate.toWorld(new vector(0, 0, -2)));
8+
bg.setAng(gate.toWorld(new angle(0, 0, -90)));
9+
bg.setScale(new vector(13, 1, 13));
10+
bg.setMaterial("models/debug/debugwhite");
11+
bg.setColor(new color(145, 140, 125));
12+
bg.parent(gate);
13+
14+
hologram ring = hololib.create("models/sprops/geometry/fring_42.mdl");
15+
ring.setPos(gate.toWorld(new vector(0, 0, 0)));
16+
ring.setAng(gate.toWorld(new angle(0, 0, -90)));
17+
ring.setScale(new vector(4.2, 1, 4.2));
18+
ring.setMaterial("models/debug/debugwhite");
19+
ring.setColor(new color(20, 20, 20));
20+
ring.parent(gate);
21+
22+
hologram cog = hololib.create("models/sprops/geometry/t_fdisc_12.mdl");
23+
cog.setPos(gate.toWorld(new vector(0, 0, 2)));
24+
cog.setAng(gate.toWorld(new angle(0, 0, -90)));
25+
cog.setScale(new vector(1, 3, 1));
26+
cog.setMaterial("models/debug/debugwhite");
27+
cog.setColor(new color(0, 0, 0));
28+
cog.parent(gate);
29+
30+
function void buildHours(int x, int y, int hour) {
31+
string h = math.toString(hour);
32+
angle ang h = gate.toWorld( new angle(0, -90, 90) );
33+
vector pos h = gate.toWorld( new vector(x, y, 0) * 60);
34+
35+
hologram frst = hololib.create("models/sprops/misc/alphanum/alphanum_" + h[1] + ".mdl");
36+
frst.setColor(new color(0, 0, 0));
37+
frst.setScale(new vector(0.5));
38+
frst.setAng(ang);
39+
if (2 == #h) pos += (frst.forward() * 2.5);
40+
41+
frst.setPos(pos);
42+
frst.parent(gate);
43+
44+
if (2 == #h) {
45+
hologram snd = hololib.create("models/sprops/misc/alphanum/alphanum_" + h[2] + ".mdl");
46+
snd.setColor(new color(0, 0, 0));
47+
snd.setScale(new vector(0.5));
48+
snd.setPos(pos - (frst.forward() * 5));
49+
snd.setAng(ang);
50+
snd.parent(gate);
51+
}
52+
}
53+
54+
function void buildMinute(int x, int y, int minute) {
55+
hologram h = hololib.create("cube");
56+
h.setScale(new vector(0.1));
57+
h.setPos( gate.toWorld( new vector(x, y, 0) * 70) );
58+
h.parent(gate);
59+
60+
if (minute % 5 == 0) {
61+
h.setColor(new color(0, 0, 0));
62+
int hour = minute / 5;
63+
if (hour == 0) hour = 12;
64+
buildHours(x, y, hour);
65+
}
66+
}
67+
68+
function void buildDisplay(int minute) {
69+
int step = ((2*math.pi()) / 60);
70+
int j = (step * minute) - (step * 15);
71+
int x = math.sin(j);
72+
int y = math.cos(j);
73+
74+
buildMinute(x, y, minute);
75+
}
76+
77+
int i = 0;
78+
timer.create("buildDisplay", 0.1, 60, function() {
79+
buildDisplay(i);
80+
i += 1;
81+
});
82+
83+
timer.create("buildHands", 7, 1, function() {
84+
85+
hologram hs = hololib.create("cube");
86+
hs.setScale(new vector(6, 0.1, 0.1));
87+
hs.setColor(new color(227, 18, 53));
88+
hs.parent(gate);
89+
90+
hologram hm = hololib.create("cube");
91+
hm.setScale(new vector(3.5, 0.1, 0.1));
92+
hm.parent(gate);
93+
94+
hologram hh = hololib.create("cube");
95+
hm.setScale(new vector(5, 0.1, 0.1));
96+
hm.parent(gate);
97+
98+
function void updateSeconds(int seconds) {
99+
int step = ((2*math.pi()) / 60);
100+
int j = (step * seconds) - (step * 15);
101+
int x = math.sin(j);
102+
int y = math.cos(j);
103+
104+
vector of = gate.up() * 1;
105+
vector center = gate.getPos();
106+
vector aimpos = gate.toWorld( new vector(x, y, 0) * 70);
107+
angle ang (center - aimpos).toAngle();
108+
hs.setPos((center + ((aimpos - center) * 0.5)) + (ang.toForward() * 4) + of);
109+
hs.setAng(ang);
110+
}
111+
112+
function void updateMinutes(int minutes) {
113+
int step = ((2*math.pi()) / 60);
114+
int j = (step * minute) - (step * 15);
115+
int x = math.sin(j);
116+
int y = math.cos(j);
117+
118+
vector of = gate.up() * 2;
119+
vector center = gate.getPos();
120+
vector aimpos = gate.toWorld( new vector(x, y, 0) * 60);
121+
angle ang (center - aimpos).toAngle();
122+
hm.setPos((center + ((aimpos - center) * 0.5)) + (ang.toForward() * 13) + of);
123+
hm.setAng(ang);
124+
}
125+
126+
function void updateHours(int hours, int minutes) {
127+
int step = ((2*math.pi()) / 12);
128+
int j = (step * hours) - ((step / 60) * minutes) - (step * 15);
129+
int x = math.sin(j);
130+
int y = math.cos(j);
131+
132+
vector of = gate.up() * 3;
133+
vector center = gate.getPos();
134+
vector aimpos = gate.toWorld( new vector(x, y, 0) * 60);
135+
angle ang (center - aimpos).toAngle();
136+
hh.setPos((center + ((aimpos - center) * 0.5)) + (ang.toForward() * 5) + of);
137+
hh.setAng(ang);
138+
}
139+
140+
timer.create("moveHands", 1, 0, function() {
141+
date now = new date(time.now());
142+
updateSeconds(now.second);
143+
updateMinutes(now.minutes);
144+
updateHours(now.hour, now.minute);
145+
});
146+
});
147+
}
171 KB
Loading
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Expression Advanced 3 - Ruskeths E3 Clock
2+
3+
## Details
4+
5+
### Author
6+
7+
- Author: Rusketh (Marcess) (Marcess TG)
8+
- Steam Profile: https://steamcommunity.com/profiles/76561197995742334
9+
- YouTube: https://www.youtube.com/@madmanrusketh2181
10+
- Github: https://github.com/Rusketh
11+
12+
### Publication Info
13+
14+
- Title: Ruskeths E3 Clock
15+
- Date (dd-mm-yyyy): 03-10-2019
16+
- Source: https://www.youtube.com/watch?v=wabnoAJXlrc
17+
- Source Accessed (dd-mm-yyyy): 28-09-2025
18+
19+
## Description
20+
21+
I made a hologram clock whilst developing E3, I am so proud of this thing.
22+
23+
Video:
24+
[YouTube - Ruskeths E3 Clock](https://www.youtube.com/watch?v=wabnoAJXlrc)
25+
26+
![image1](image1.jpg)

GarrysMod/garrysmod/data/expression2/vehicles/trains/RuskethsAmazing Holo Train/info.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Author: Rusketh (Marcess) (Marcess TG)
88
- Steam Profile: https://steamcommunity.com/profiles/76561197995742334
99
- YouTube: https://www.youtube.com/@madmanrusketh2181
10+
- Github: https://github.com/Rusketh
1011

1112
### Publication Info
1213

0 commit comments

Comments
 (0)