-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3Dinteroperability
More file actions
531 lines (502 loc) · 31.2 KB
/
Copy path3Dinteroperability
File metadata and controls
531 lines (502 loc) · 31.2 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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>REALITYCRAFT & 3D INTEROPERABILITY</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Inter', sans-serif;
background: #0F0C29;
background: -webkit-linear-gradient(to right, #24243E, #302B63, #0F0C29);
background: linear-gradient(to right, #24243E, #302B63, #0F0C29);
}
.prismatic-card {
background: rgba(255, 255, 255, 0.05);
backdrop-filter: blur(15px);
border: 1px solid rgba(255, 255, 255, 0.1);
transition: all 0.3s ease-in-out;
}
.prismatic-card:hover {
transform: translateY(-8px) scale(1.02);
box-shadow: 0 20px 40px rgba(0,0,0,0.3);
border-color: rgba(236, 72, 153, 0.6);
}
.prismatic-header {
font-size: 3rem;
line-height: 1.1;
font-weight: 900;
background: -webkit-linear-gradient(45deg, #EC4899, #FDE047, #38BDF8, #A78BFA);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
animation: gradient-flow 10s ease infinite;
background-size: 400% 400%;
}
@media (min-width: 768px) {
.prismatic-header {
font-size: 4.5rem;
}
}
@keyframes gradient-flow {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
.chart-container {
position: relative;
width: 100%;
height: 400px;
}
#interactive-3d-viewer {
width: 100%;
height: 100%;
cursor: grab;
border-radius: 1rem;
}
#interactive-3d-viewer:active { cursor: grabbing; }
.modal-overlay {
position: fixed; top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0, 0, 0, 0.7);
backdrop-filter: blur(5px);
display: flex; align-items: center; justify-content: center;
z-index: 50;
opacity: 0; visibility: hidden;
transition: all 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
background: linear-gradient(135deg, #1e1b4b, #312e6a);
color: #e0e7ff;
padding: 2rem; border-radius: 1rem;
width: 90%; max-width: 600px;
max-height: 90vh; overflow-y: auto;
transform: scale(0.9);
transition: transform 0.3s ease;
border: 1px solid rgba(167, 139, 250, 0.4);
}
.modal-overlay.active .modal-content { transform: scale(1); }
.feature-icon {
background: -webkit-linear-gradient(45deg, #EC4899, #A78BFA);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.connector-line {
width: 2px;
height: 3rem;
background: linear-gradient(to bottom, #a78bfa, #ec4899);
}
.toggle-switch {
position: relative;
display: inline-block;
width: 50px;
height: 28px;
}
.toggle-switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #312e6a;
transition: .4s;
border-radius: 28px;
}
.slider:before {
position: absolute;
content: "";
height: 20px;
width: 20px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked + .slider {
background-color: #EC4899;
}
input:checked + .slider:before {
transform: translateX(22px);
}
</style>
</head>
<body class="text-indigo-100">
<header class="text-center py-16 md:py-24 px-4">
<h1 class="prismatic-header uppercase">REALITYCRAFT & 3D INTEROPERABILITY</h1>
<p class="text-lg md:text-xl mt-4 max-w-3xl mx-auto text-indigo-200">The definitive guide to the open standards pipeline for creating portable, dynamic 3D assets that live everywhere.</p>
</header>
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pb-16">
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
<section class="lg:col-span-3 prismatic-card rounded-2xl p-6 md:p-8">
<h2 class="text-3xl font-bold text-center text-pink-400 mb-6">What is a glTF™ Asset?</h2>
<p class="text-center text-indigo-200 max-w-4xl mx-auto mb-8">Defined by Khronos, glTF is the open standard for 3D assets, often called the "JPEG of 3D." It's not just a model format; it's a complete scene description designed for efficient transmission and loading of 3D content on any platform.</p>
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-8 text-center">
<div class="flex flex-col items-center">
<span class="text-6xl feature-icon">📦</span>
<h3 class="font-bold text-lg mt-2 text-white">Compact & Efficient</h3>
<p class="text-sm text-indigo-300 mt-1">Uses binary containers (.glb) to package geometry, textures, and animation into a single, small file for fast web delivery.</p>
</div>
<div class="flex flex-col items-center">
<span class="text-6xl feature-icon">🎨</span>
<h3 class="font-bold text-lg mt-2 text-white">PBR Materials</h3>
<p class="text-sm text-indigo-300 mt-1">Standardizes Physically-Based Rendering, ensuring your asset's appearance is consistent across all viewers and lighting conditions.</p>
</div>
<div class="flex flex-col items-center">
<span class="text-6xl feature-icon">🤸</span>
<h3 class="font-bold text-lg mt-2 text-white">Full Animation</h3>
<p class="text-sm text-indigo-300 mt-1">Includes a robust animation system for skeletal (skinning/rigging) and object transformations (move, rotate, scale).</p>
</div>
<div class="flex flex-col items-center">
<span class="text-6xl feature-icon">🧩</span>
<h3 class="font-bold text-lg mt-2 text-white">Extensible</h3>
<p class="text-sm text-indigo-300 mt-1">A core feature set can be expanded with extensions for physics, interactivity, advanced materials, and more.</p>
</div>
</div>
</section>
<section class="lg:col-span-3 prismatic-card rounded-2xl p-6 md:p-8">
<h2 class="text-3xl font-bold text-center text-cyan-300 mb-6">Interactive Asset Preview: glTF in Action</h2>
<div class="flex flex-col lg:flex-row gap-8">
<div class="lg:w-2/3">
<div class="chart-container bg-indigo-900/50 rounded-2xl">
<div id="interactive-3d-viewer"></div>
</div>
</div>
<div class="lg:w-1/3 flex flex-col justify-center">
<h3 class="font-bold text-xl text-white mb-4">Runtime Interactivity</h3>
<p class="text-indigo-200 text-sm mb-6">A glTF asset is not a static object; it's a live scene graph. Its properties can be accessed and modified by code at runtime. This is the key to interoperability: an asset can change its look and function to fit any world or platform. Use the controls below to see this in action.</p>
<div class="space-y-4">
<div class="flex items-center justify-between bg-black/20 p-3 rounded-lg">
<label for="color-toggle" class="font-semibold text-white">Change Color</label>
<label class="toggle-switch">
<input type="checkbox" id="color-toggle">
<span class="slider"></span>
</label>
</div>
<div class="flex items-center justify-between bg-black/20 p-3 rounded-lg">
<label for="wireframe-toggle" class="font-semibold text-white">Toggle Wireframe</label>
<label class="toggle-switch">
<input type="checkbox" id="wireframe-toggle">
<span class="slider"></span>
</label>
</div>
<div class="flex items-center justify-between bg-black/20 p-3 rounded-lg">
<label for="rotate-toggle" class="font-semibold text-white">Pause Animation</label>
<label class="toggle-switch">
<input type="checkbox" id="rotate-toggle">
<span class="slider"></span>
</label>
</div>
</div>
</div>
</div>
</section>
<section class="lg:col-span-3 prismatic-card rounded-2xl p-6 md:p-8">
<h2 class="text-3xl font-bold text-center text-yellow-300 mb-6">From Blender to Web: The glTF Export Pipeline</h2>
<p class="text-center text-indigo-200 max-w-4xl mx-auto mb-8">Creating a performant glTF asset requires a specific workflow inside your 3D authoring tool (like Blender) before you export.</p>
<div class="flex flex-col lg:flex-row items-center justify-between space-y-8 lg:space-y-0 lg:space-x-4 text-center">
<div class="flex flex-col items-center">
<div class="w-24 h-24 bg-gradient-to-br from-purple-500 to-indigo-600 rounded-full flex items-center justify-center text-4xl shadow-lg">📦</div>
<h3 class="font-bold text-lg mt-4">1. Modeling & UVs</h3>
<p class="text-sm text-indigo-300 w-48">Create low-poly models. Ensure clean topology and non-overlapping UV maps for textures.</p>
</div>
<div class="text-4xl text-purple-400 transform lg:rotate-0 rotate-90">→</div>
<div class="flex flex-col items-center">
<div class="w-24 h-24 bg-gradient-to-br from-pink-500 to-rose-600 rounded-full flex items-center justify-center text-4xl shadow-lg">🎨</div>
<h3 class="font-bold text-lg mt-4">2. PBR Texturing</h3>
<p class="text-sm text-indigo-300 w-48">Use the Principled BSDF shader. Connect Base Color, Metallic, Roughness, and Normal maps.</p>
</div>
<div class="text-4xl text-pink-400 transform lg:rotate-0 rotate-90">→</div>
<div class="flex flex-col items-center">
<div class="w-24 h-24 bg-gradient-to-br from-sky-500 to-cyan-600 rounded-full flex items-center justify-center text-4xl shadow-lg">⚙️</div>
<h3 class="font-bold text-lg mt-4">3. Export Settings</h3>
<p class="text-sm text-indigo-300 w-48">Use the glTF 2.0 exporter. Enable "Apply Modifiers" and "Compress" (Draco) options.</p>
</div>
<div class="text-4xl text-cyan-400 transform lg:rotate-0 rotate-90">→</div>
<div class="flex flex-col items-center">
<div class="w-24 h-24 bg-gradient-to-br from-yellow-400 to-amber-500 rounded-full flex items-center justify-center text-4xl shadow-lg">✔️</div>
<h3 class="font-bold text-lg mt-4">4. Ready Asset</h3>
<p class="text-sm text-indigo-300 w-48">The result is a self-contained, performant `.glb` or `.gltf` file.</p>
</div>
</div>
</section>
<section class="lg:col-span-3 prismatic-card rounded-2xl p-6 md:p-8">
<h2 class="text-3xl font-bold text-center text-yellow-300 mb-6">In-Depth Creator Workflow</h2>
<p class="text-center text-indigo-200 max-w-4xl mx-auto mb-8">Each step in the production pipeline is critical for creating scalable and interoperable content. Click on any step below to reveal detailed information, tools, and best practices.</p>
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-6 text-center">
<div id="step-1" class="prismatic-card p-4 rounded-lg cursor-pointer">
<div class="text-5xl">🖌️</div>
<h3 class="font-bold mt-2">1. Author</h3>
<p class="text-xs mt-1 text-indigo-300">Model, texture, and animate your 3D assets.</p>
</div>
<div id="step-2" class="prismatic-card p-4 rounded-lg cursor-pointer">
<div class="text-5xl">🔎</div>
<h3 class="font-bold mt-2">2. Validate</h3>
<p class="text-xs mt-1 text-indigo-300">Check for errors and spec conformance.</p>
</div>
<div id="step-3" class="prismatic-card p-4 rounded-lg cursor-pointer">
<div class="text-5xl">⚙️</div>
<h3 class="font-bold mt-2">3. Optimize</h3>
<p class="text-xs mt-1 text-indigo-300">Compress geometry, textures, and more.</p>
</div>
<div id="step-4" class="prismatic-card p-4 rounded-lg cursor-pointer">
<div class="text-5xl">🧩</div>
<h3 class="font-bold mt-2">4. Tile</h3>
<p class="text-xs mt-1 text-indigo-300">Stream massive datasets with 3D Tiles.</p>
</div>
<div id="step-5" class="prismatic-card p-4 rounded-lg cursor-pointer">
<div class="text-5xl">🚀</div>
<h3 class="font-bold mt-2">5. Deploy</h3>
<p class="text-xs mt-1 text-indigo-300">Integrate into your web application.</p>
</div>
</div>
</section>
<section class="lg:col-span-3 prismatic-card rounded-2xl p-6 md:p-8">
<h2 class="text-3xl font-bold text-center text-pink-400 mb-6">Unlocking True Interoperability</h2>
<p class="text-center text-indigo-200 max-w-4xl mx-auto mb-8">A single glTF asset is the key to content that can live and react across countless platforms. This is achieved by layering functionality through extensions and connecting to live data with webhooks.</p>
<div class="flex flex-col items-center w-full">
<div class="prismatic-card p-4 rounded-xl border-2 border-pink-500 shadow-2xl">
<h3 class="font-bold text-lg text-center">Master .glb Asset</h3>
</div>
<div class="connector-line"></div>
<div class="flex flex-col md:flex-row justify-around w-full items-center">
<div class="flex flex-col items-center m-4">
<h4 class="font-bold text-cyan-300">Extensions for Functionality</h4>
<p class="text-xs text-center max-w-xs text-indigo-300">Add features like interactivity, physics, or custom shaders that platforms can choose to support.</p>
</div>
<div class="flex flex-col items-center m-4">
<h4 class="font-bold text-yellow-300">Webhooks for Dynamic Data</h4>
<p class="text-xs text-center max-w-xs text-indigo-300">Connect your asset to external APIs. Update colors, text, or trigger animations based on real-world events.</p>
</div>
</div>
<div class="connector-line"></div>
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 w-full max-w-4xl mt-4">
<div class="prismatic-card p-4 rounded-lg text-center">🌐<span class="block font-semibold text-sm">Web Browser</span></div>
<div class="prismatic-card p-4 rounded-lg text-center">👓<span class="block font-semibold text-sm">VR Headset</span></div>
<div class="prismatic-card p-4 rounded-lg text-center">📱<span class="block font-semibold text-sm">AR on Mobile</span></div>
<div class="prismatic-card p-4 rounded-lg text-center">🎮<span class="block font-semibold text-sm">Game Engine</span></div>
</div>
</div>
</section>
<section class="lg:col-span-3 bg-transparent rounded-2xl p-6 md:p-8 text-white">
<h2 class="text-3xl font-bold text-center text-cyan-300 mb-4">Performance: Monolithic vs. Tiled</h2>
<p class="text-center text-sm text-indigo-200 mb-6">For world-scale scenes, interoperability depends on performance. A tiled approach with 3D Tiles maintains a smooth experience, while a single monolithic file fails.</p>
<div class="chart-container">
<canvas id="performanceChart"></canvas>
</div>
</section>
</div>
</main>
<div id="modal" class="modal-overlay">
<div class="modal-content">
<h3 id="modal-title" class="text-2xl font-bold text-yellow-300 mb-4"></h3>
<div id="modal-body" class="text-indigo-200 space-y-4"></div>
<button id="modal-close" class="mt-6 w-full bg-pink-600 hover:bg-pink-500 text-white font-bold py-2 px-4 rounded-lg transition-colors">Close</button>
</div>
</div>
<footer class="text-center py-8 px-4 mt-16">
<p class="text-lg font-bold text-white mt-2">REALITYCRAFT.APP</p>
</footer>
<script>
document.addEventListener('DOMContentLoaded', () => {
const scene = new THREE.Scene();
const container = document.getElementById('interactive-3d-viewer');
if (!container) return;
const camera = new THREE.PerspectiveCamera(75, container.clientWidth / container.clientHeight, 0.1, 1000);
camera.position.z = 2.5;
const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
renderer.setSize(container.clientWidth, container.clientHeight);
renderer.setPixelRatio(window.devicePixelRatio);
container.appendChild(renderer.domElement);
const ambientLight = new THREE.AmbientLight(0xffffff, 0.7);
scene.add(ambientLight);
const directionalLight = new THREE.DirectionalLight(0xffffff, 1);
directionalLight.position.set(2, 3, 4);
scene.add(directionalLight);
const geometry = new THREE.TorusKnotGeometry(0.8, 0.25, 100, 16);
const originalColor = 0xEC4899;
const alternateColor = 0x38BDF8;
const material = new THREE.MeshStandardMaterial({
color: originalColor,
metalness: 0.2,
roughness: 0.4,
emissive: 0x1E1B4B,
});
const knot = new THREE.Mesh(geometry, material);
scene.add(knot);
let isMouseDown = false;
let previousMousePosition = { x: 0, y: 0 };
let autoRotate = true;
function onPointerDown(e) { isMouseDown = true; }
function onPointerUp() { isMouseDown = false; }
function onPointerMove(e) {
if (!isMouseDown) return;
const deltaX = e.clientX - previousMousePosition.x;
const deltaY = e.clientY - previousMousePosition.y;
knot.rotation.y += deltaX * 0.01;
knot.rotation.x += deltaY * 0.01;
previousMousePosition.x = e.clientX;
previousMousePosition.y = e.clientY;
}
container.addEventListener('pointerdown', (e) => {
isMouseDown = true;
previousMousePosition = { x: e.clientX, y: e.clientY };
});
container.addEventListener('pointerup', onPointerUp);
container.addEventListener('pointerleave', onPointerUp);
container.addEventListener('pointermove', onPointerMove);
window.addEventListener('resize', () => {
camera.aspect = container.clientWidth / container.clientHeight;
camera.updateProjectionMatrix();
renderer.setSize(container.clientWidth, container.clientHeight);
});
function animate() {
requestAnimationFrame(animate);
if (autoRotate && !isMouseDown) {
knot.rotation.x += 0.002;
knot.rotation.y += 0.002;
}
renderer.render(scene, camera);
}
animate();
document.getElementById('color-toggle').addEventListener('change', (e) => {
knot.material.color.set(e.target.checked ? alternateColor : originalColor);
});
document.getElementById('wireframe-toggle').addEventListener('change', (e) => {
knot.material.wireframe = e.target.checked;
});
document.getElementById('rotate-toggle').addEventListener('change', (e) => {
autoRotate = !e.target.checked;
});
const modalData = {
"step-1": {
title: "1. Authoring Assets",
body: `<p>This is the creative foundation. The goal is to produce 3D models that are not only visually appealing but also technically optimized for real-time rendering.</p>
<h4 class="font-bold mt-4 text-pink-400">Key Tools:</h4>
<ul class="list-disc list-inside"><li><strong>Blender:</strong> The premier open-source tool for 3D modeling, sculpting, and animation.</li><li><strong>Substance Painter:</strong> Industry standard for creating high-quality PBR textures.</li></ul>
<h4 class="font-bold mt-4 text-pink-400">Best Practices:</h4>
<ul class="list-disc list-inside"><li><strong>Low Polygon Count:</strong> Aim for the lowest polygon count that maintains visual fidelity. Use normal maps to fake high-resolution details.</li><li><strong>PBR Materials:</strong> Exclusively use the Principled BSDF shader. This maps directly to glTF's PBR material model.</li><li><strong>Power-of-Two Textures:</strong> Use texture dimensions like 1024x1024 or 2048x2048 for optimal memory usage and compatibility.</li></ul>`
},
"step-2": {
title: "2. Validating Conformance",
body: `<p>Before optimization, ensure your exported glTF file is valid and conforms to the official specification. This step catches errors early and prevents issues in downstream applications.</p>
<h4 class="font-bold mt-4 text-pink-400">Key Tool:</h4>
<a href="https://github.khronos.org/glTF-Validator/" target="_blank" class="text-yellow-300 hover:text-yellow-400"><strong>Official Khronos glTF Validator:</strong></a> A web-based tool where you can drag-and-drop your .gltf or .glb file to get a detailed report.
<h4 class="font-bold mt-4 text-pink-400">Common Issues to Check:</h4>
<ul class="list-disc list-inside"><li>Missing textures or binary data.</li><li>Incorrectly configured material properties.</li><li>Invalid animation paths or accessors.</li></ul>`
},
"step-3": {
title: "3. Optimizing for Performance",
body: `<p>Optimization is the process of reducing file size and improving rendering performance without significantly impacting visual quality. This is arguably the most important step for web-based delivery.</p>
<h4 class="font-bold mt-4 text-pink-400">Key Tool:</h4>
<a href="https://gltf-transform.dev/" target="_blank" class="text-yellow-300 hover:text-yellow-400"><strong>glTF-Transform:</strong></a> A powerful command-line tool for surgical optimizations.
<h4 class="font-bold mt-4 text-pink-400">Example CLI Commands:</h4>
<pre class="bg-gray-900 p-2 rounded-md text-sm whitespace-pre-wrap"><code># Compress textures and geometry\ngltf-transform draco input.glb output.glb\ngltf-transform ktx2 input.glb output.glb</code></pre>
<p class="mt-2">These commands apply Draco mesh compression and KTX2 universal texture compression, drastically reducing file size.</p>`
},
"step-4": {
title: "4. Tiling for Massive Worlds",
body: `<p>When a single model is too large to load into memory (e.g., a city, a factory, a detailed scan), you must convert it into a streamable format like 3D Tiles.</p>
<h4 class="font-bold mt-4 text-pink-400">Key Concept:</h4>
<p>3D Tiles breaks the model into a hierarchy of smaller chunks. The viewer then selectively loads only the chunks that are currently in view, based on the camera's position. This is called Level of Detail (LOD) streaming.</p>
<h4 class="font-bold mt-4 text-pink-400">Key Tool:</h4>
<a href="https://cesium.com/platform/cesium-ion/" target="_blank" class="text-yellow-300 hover:text-yellow-400"><strong>Cesium ion:</strong></a> A cloud platform that can ingest massive 3D models and automatically generate optimized 3D Tilesets for streaming.</p>`
},
"step-5": {
title: "5. Deploying to the Web",
body: `<p>The final step is to load your optimized and/or tiled asset into a web application for users to experience.</p>
<h4 class="font-bold mt-4 text-pink-400">Key Libraries:</h4>
<ul class="list-disc list-inside"><li><strong>Three.js:</strong> A versatile library for general-purpose 3D graphics, excellent for loading individual glTF assets.</li><li><strong>CesiumJS:</strong> A specialized library for high-precision, world-scale geospatial visualization, required for rendering 3D Tiles.</li></ul>
<h4 class="font-bold mt-4 text-pink-400">Example (Three.js):</h4>
<pre class="bg-gray-900 p-2 rounded-md text-sm whitespace-pre-wrap"><code>import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';\n\nconst loader = new GLTFLoader();\nloader.load('asset.glb', (gltf) => {\n scene.add(gltf.scene);\n});</code></pre>`
}
};
const modal = document.getElementById('modal');
const modalTitle = document.getElementById('modal-title');
const modalBody = document.getElementById('modal-body');
const modalClose = document.getElementById('modal-close');
document.querySelectorAll('.prismatic-card[id^="step-"]').forEach(card => {
card.addEventListener('click', () => {
const data = modalData[card.id];
if (data) {
modalTitle.textContent = data.title;
modalBody.innerHTML = data.body;
modal.classList.add('active');
}
});
});
const closeModal = () => modal.classList.remove('active');
modalClose.addEventListener('click', closeModal);
modal.addEventListener('click', (e) => {
if (e.target === modal) closeModal();
});
const chartOptions = {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: { labels: { color: '#e0e7ff', font: { size: 14 } } }
},
scales: {
y: {
type: 'logarithmic',
title: { display: true, text: 'Resource Usage (Log Scale)', color: '#c7d2fe', font: {size: 14}},
grid: { color: 'rgba(167, 139, 250, 0.2)' },
ticks: { color: '#c7d2fe' }
},
x: {
title: { display: true, text: 'World Complexity', color: '#c7d2fe', font: {size: 14}},
grid: { display: false },
ticks: { color: '#c7d2fe' }
}
}
};
const performanceCtx = document.getElementById('performanceChart')?.getContext('2d');
if (performanceCtx) {
new Chart(performanceCtx, {
type: 'line',
data: {
labels: ['10k', '1M', '100M', '1B Polys'],
datasets: [{
label: 'Monolithic glTF',
data: [10, 250, 6000, null],
borderColor: '#FDE047',
backgroundColor: 'rgba(253, 224, 71, 0.2)',
fill: true,
tension: 0.4,
pointRadius: 5,
pointBackgroundColor: '#FDE047'
}, {
label: '3D Tiles Stream',
data: [8, 12, 16, 20],
borderColor: '#EC4899',
backgroundColor: 'rgba(236, 72, 153, 0.2)',
fill: true,
tension: 0.4,
pointRadius: 5,
pointBackgroundColor: '#EC4899'
}]
},
options: chartOptions
});
}
});
</script>
</body>
</html>
<iframe
src="https://lightlodges.github.io/realitycraft/glTFinfographic.html"
width="100%"
height="700"
style="border:none; border-radius:12px; overflow:hidden;">
</iframe>