-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·350 lines (303 loc) · 11.9 KB
/
Copy pathindex.html
File metadata and controls
executable file
·350 lines (303 loc) · 11.9 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>vid potocnik.</title>
<link href="static/base.css" rel="stylesheet" type="text/css" />
<link
rel="shortcut icon"
type="image/jpg"
href="static/favicon/favicon.ico"
/>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-VK41LTPKL0"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "G-VK41LTPKL0");
</script>
</head>
<body>
<div id="contents">
<div style="font-size: 400%" id="title">vid potocnik.</div>
<br />
<strong>presence</strong>
<ul style="list-style: none">
<li>
0000,
<a href="/static/Vid_Europass.pdf" target="”_blank”">Resume</a>.
</li>
<li>
0001,
<a href="https://github.com/potocnikvid" target="”_blank”"
>@potocnikvid</a
>, on github.
</li>
<li>
0002,
<a href="https://www.linkedin.com/in/vidpotocnik/" target="”_blank”"
>@vidpotocnik</a
>, on linkedin.
</li>
<li>
0003,
<a href="https://instagram.com/vdptcnk" target="”_blank”">@vdptcnk</a
>, on instagram.
</li>
<li>
0004,
<a href="https://instagram.com/vidpotocnik" target="”_blank”"
>@vidpotocnik</a
>, on instagram.
</li>
<li>
0005,
<a href="https://unsplash.com/@vidpotocnik" target="”_blank”"
>@vidpotocnik</a
>, on unsplash.
</li>
<li>
0006,
<a href="https://twitter.com/vdptcnk" target="”_blank”">@vdptcnk</a>,
on twitter.
</li>
<li>
0007, <a href="https://kit.co/vid" target="”_blank”">@vid</a>, on kit.
</li>
</ul>
<strong>presently</strong>
<ul style="list-style: none">
<li>2019-, studying computer science at FRI, Ljubljana.</li>
<li>2022-, writing diploma on <a href="https://github.com/potocnikvid/fri-diploma" target="”_blank”"
>Kinship analysis</a></li>
</ul>
<strong>previously</strong>
<ul style="list-style: none">
<li>
2015-2019,
<a href="https://www.prvagim.si/" target="_blank"
>i. gimnazija v celju</a
>
</li>
<li>
2019-, Multimedia creator @ Agencija Sinhron d.o.o
</li>
</ul>
<!-- <strong>stuff</strong>
<ul style="list-style: none">
<li>0001, <a href="/pages/books.html">books.</a></li>
<li>0002, <a href="/pages/podcasts.html">podcasts.</a></li> -->
<!-- <li>0003, <a href="/pages/tictactoe.html">tictactoe.</a></li> -->
<!-- </ul> -->
<!-- <div id="pantone">Pantone 530C</div> -->
</div>
<script src="https://ajax.googleapis.com/ajax/libs/threejs/r84/three.min.js"></script>
<script>
var ImprovedNoise = function () {
var p = [151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, 103, 30, 69,
142, 8, 99, 37, 240, 21, 10,
23, 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117, 35, 11, 32, 57, 177,
33, 88, 237, 149, 56, 87,
174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, 134, 139, 48, 27, 166, 77, 146, 158, 231, 83,
111, 229, 122, 60, 211,
133, 230, 220, 105, 92, 41, 55, 46, 245, 40, 244, 102, 143, 54, 65, 25, 63, 161, 1, 216, 80, 73,
209, 76, 132, 187, 208,
89, 18, 169, 200, 196, 135, 130, 116, 188, 159, 86, 164, 100, 109, 198, 173, 186, 3, 64, 52,
217, 226, 250, 124, 123, 5,
202, 38, 147, 118, 126, 255, 82, 85, 212, 207, 206, 59, 227, 47, 16, 58, 17, 182, 189, 28, 42,
223, 183, 170, 213, 119,
248, 152, 2, 44, 154, 163, 70, 221, 153, 101, 155, 167, 43, 172, 9, 129, 22, 39, 253, 19, 98,
108, 110, 79, 113, 224, 232,
178, 185, 112, 104, 218, 246, 97, 228, 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241,
81, 51, 145, 235, 249,
14, 239, 107, 49, 192, 214, 31, 181, 199, 106, 157, 184, 84, 204, 176, 115, 121, 50, 45, 127, 4,
150, 254, 138, 236, 205,
93, 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, 61, 156, 180
];
for (var i = 0; i < 256; i++) {
p[256 + i] = p[i];
}
function fade(t) {
return t * t * t * (t * (t * 6 - 15) + 10);
}
function lerp(t, a, b) {
return a + t * (b - a);
}
function grad(hash, x, y, z) {
var h = hash & 15;
var u = h < 8 ? x : y,
v = h < 4 ? y : h == 12 || h == 14 ? x : z;
return ((h & 1) == 0 ? u : -u) + ((h & 2) == 0 ? v : -v);
}
return {
noise: function (x, y, z) {
var floorX = Math.floor(x),
floorY = Math.floor(y),
floorZ = Math.floor(z);
var X = floorX & 255,
Y = floorY & 255,
Z = floorZ & 255;
x -= floorX;
y -= floorY;
z -= floorZ;
var xMinus1 = x - 1,
yMinus1 = y - 1,
zMinus1 = z - 1;
var u = fade(x),
v = fade(y),
w = fade(z);
var A = p[X] + Y,
AA = p[A] + Z,
AB = p[A + 1] + Z,
B = p[X + 1] + Y,
BA = p[B] + Z,
BB = p[B + 1] + Z;
return lerp(w, lerp(v, lerp(u, grad(p[AA], x, y, z),
grad(p[BA], xMinus1, y, z)),
lerp(u, grad(p[AB], x, yMinus1, z),
grad(p[BB], xMinus1, yMinus1, z))),
lerp(v, lerp(u, grad(p[AA + 1], x, y, zMinus1),
grad(p[BA + 1], xMinus1, y, z - 1)),
lerp(u, grad(p[AB + 1], x, yMinus1, zMinus1),
grad(p[BB + 1], xMinus1, yMinus1, zMinus1))));
}
}
}
</script>
<script>
const terrainWidth = 64;
const terrainDepth = 64;
const noiseScale = 0.99;
const noiseScale2 = 0.05;
const heightScale = 10;
const heightScale2 = 5;
const tileSize = 10;
const normalMitigation = 100;
let offsetX = 0;
let offsetZ = 0;
let scene = new THREE.Scene();
let camera = new THREE.PerspectiveCamera(
80,
window.innerWidth / window.innerHeight
);
camera.position.z = terrainDepth * tileSize * 0.5;
camera.position.y = 30;
camera.position.x = terrainWidth * tileSize * 0.5;
scene.add(camera);
let renderer = new THREE.WebGLRenderer();
// renderer.setPixelRatio(0.5);
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
window.addEventListener("resize", function () {
renderer.setSize(window.innerWidth, window.innerHeight);
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
});
let rebuild = function () {
let terrainGeometry = new THREE.Geometry();
let verts = [];
let normals = [];
let tris = [];
let noiseGen = new ImprovedNoise();
let getNoise = (x, z) => noiseGen.noise(x, z, 0);
let cross = (a, b) => {
let out = new THREE.Vector3();
out.crossVectors(a, b);
return out;
};
let sub = (a, b) => {
let out = new THREE.Vector3();
out.subVectors(a, b);
return out;
};
let add = (a, b) => {
let out = new THREE.Vector3();
out.addVectors(a, b);
return out;
};
for (let x = 0; x < terrainWidth; x++) {
for (let z = 0; z < terrainDepth; z++) {
let px = x;
let pz = z;
let py = getNoise(px * noiseScale, pz * noiseScale) * heightScale;
py *= getNoise(px * noiseScale2, py * noiseScale2);
py += Math.sin(px / 4 - pz / 4 - offsetX) * heightScale2;
let p0 = new THREE.Vector3(px * tileSize, py, pz * tileSize);
px = x;
pz = z + 1;
py = getNoise(px * noiseScale, pz * noiseScale) * heightScale;
py *= getNoise(px * noiseScale2, py * noiseScale2);
py += Math.sin(px / 4 - pz / 4 - offsetX) * heightScale2;
let p1 = new THREE.Vector3(px * tileSize, py, pz * tileSize);
px = x + 1;
pz = z + 1;
py = getNoise(px * noiseScale, pz * noiseScale) * heightScale;
py *= getNoise(px * noiseScale2, py * noiseScale2);
py += Math.sin(px / 4 - pz / 4 - offsetX) * heightScale2;
let p2 = new THREE.Vector3(px * tileSize, py, pz * tileSize);
px = x + 1;
pz = z;
py = getNoise(px * noiseScale, pz * noiseScale) * heightScale;
py *= getNoise(px * noiseScale2, py * noiseScale2);
py += Math.sin(px / 4 - pz / 4 - offsetX) * heightScale2;
let p3 = new THREE.Vector3(px * tileSize, py, pz * tileSize);
let index = terrainGeometry.vertices.length;
terrainGeometry.vertices.push(p0, p1, p2, p3);
let n0 = cross(sub(p1, p0), sub(p2, p0));
let n1 = cross(sub(p2, p0), sub(p3, p0));
let normal = add(n0, n1);
normal.multiplyScalar(0.5);
let up = new THREE.Vector3(0, 1, 0);
up.multiplyScalar(normalMitigation);
normal = add(normal, up);
normal.multiplyScalar(0.5);
terrainGeometry.faces.push(
new THREE.Face3(index, index + 1, index + 2, normal),
new THREE.Face3(index + 2, index + 3, index, normal)
);
}
}
return terrainGeometry;
};
let geometry = rebuild();
let mat = new THREE.MeshBasicMaterial({
color: "#eee",
wireframe: true,
});
let terrainGeometryMesh = new THREE.Mesh(geometry, mat);
scene.add(terrainGeometryMesh);
camera.lookAt(new THREE.Vector3(0, 0, 0));
let directionalLight = new THREE.DirectionalLight(0xffffff, 1);
scene.add(directionalLight);
scene.background = new THREE.Color(0xffffff);
let render = (step) => {
offsetX += 0.05;
offsetZ += 0.05;
let oldGeometry = terrainGeometryMesh.geometry;
if (oldGeometry != null) {
oldGeometry.dispose();
}
let geometry = rebuild();
terrainGeometryMesh.geometry = geometry;
renderer.render(scene, camera);
window.requestAnimationFrame(render);
};
window.requestAnimationFrame(render);
</script>
<canvas width="941" height="907" style="width: 941px; height: 907px;">
<!-- <script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-45302508-1', 'naveen.com');
ga('send', 'pageview');
</> -->
</body>
</html>