@vib3code/sdk 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +118 -0
- package/DOCS/BLUEPRINT_EXECUTION_PLAN_2026-01-07.md +34 -0
- package/DOCS/CI_TESTING.md +38 -0
- package/DOCS/CLI_ONBOARDING.md +75 -0
- package/DOCS/CONTROL_REFERENCE.md +64 -0
- package/DOCS/DEV_TRACK_ANALYSIS.md +77 -0
- package/DOCS/DEV_TRACK_PLAN_2026-01-07.md +42 -0
- package/DOCS/DEV_TRACK_SESSION_2026-01-31.md +220 -0
- package/DOCS/ENV_SETUP.md +189 -0
- package/DOCS/EXPORT_FORMATS.md +417 -0
- package/DOCS/GPU_DISPOSAL_GUIDE.md +21 -0
- package/DOCS/LICENSING_TIERS.md +275 -0
- package/DOCS/MASTER_PLAN_2026-01-31.md +570 -0
- package/DOCS/OBS_SETUP_GUIDE.md +98 -0
- package/DOCS/PROJECT_SETUP.md +66 -0
- package/DOCS/RENDERER_LIFECYCLE.md +40 -0
- package/DOCS/REPO_MANIFEST.md +121 -0
- package/DOCS/SESSION_014_PLAN.md +195 -0
- package/DOCS/SESSION_LOG_2026-01-07.md +56 -0
- package/DOCS/STRATEGIC_BLUEPRINT_2026-01-07.md +72 -0
- package/DOCS/SYSTEM_AUDIT_2026-01-30.md +738 -0
- package/DOCS/SYSTEM_INVENTORY.md +520 -0
- package/DOCS/TELEMETRY_EXPORTS.md +34 -0
- package/DOCS/WEBGPU_STATUS.md +38 -0
- package/DOCS/XR_BENCHMARKS.md +608 -0
- package/LICENSE +21 -0
- package/README.md +426 -0
- package/docs/.nojekyll +0 -0
- package/docs/01-dissolution_of_euclidean_hegemony.html +346 -0
- package/docs/02-hyperspatial_ego_death.html +346 -0
- package/docs/03-post_cartesian_sublime.html +346 -0
- package/docs/04-crystalline_void_meditation.html +346 -0
- package/docs/05-quantum_decoherence_ballet.html +346 -0
- package/docs/06-dissolution_of_euclidean_hegemony.html +346 -0
- package/docs/07-hyperspatial_ego_death.html +346 -0
- package/docs/08-post_cartesian_sublime.html +346 -0
- package/docs/09-crystalline_void_meditation.html +346 -0
- package/docs/10-quantum_decoherence_ballet.html +346 -0
- package/docs/11-dissolution_of_euclidean_hegemony.html +346 -0
- package/docs/12-hyperspatial_ego_death.html +346 -0
- package/docs/13-post_cartesian_sublime.html +346 -0
- package/docs/index.html +794 -0
- package/docs/test-hub.html +441 -0
- package/docs/url-state.js +102 -0
- package/docs/vib3-exports/01-quantum-quantum-tetrahedron-lattice.html +489 -0
- package/docs/vib3-exports/02-quantum-quantum-hypersphere-matrix.html +489 -0
- package/docs/vib3-exports/03-quantum-quantum-hypertetra-fractal.html +489 -0
- package/docs/vib3-exports/04-faceted-faceted-crystal-structure.html +407 -0
- package/docs/vib3-exports/05-faceted-faceted-klein-bottle.html +407 -0
- package/docs/vib3-exports/06-faceted-faceted-hypertetra-torus.html +407 -0
- package/docs/vib3-exports/07-holographic-holographic-wave-field.html +457 -0
- package/docs/vib3-exports/08-holographic-holographic-hypersphere-sphere.html +457 -0
- package/docs/vib3-exports/09-holographic-holographic-hypertetra-crystal.html +457 -0
- package/docs/vib3-exports/index.html +238 -0
- package/docs/webgpu-live.html +702 -0
- package/package.json +367 -0
- package/src/advanced/AIPresetGenerator.js +777 -0
- package/src/advanced/MIDIController.js +703 -0
- package/src/advanced/OffscreenWorker.js +1051 -0
- package/src/advanced/WebGPUCompute.js +1051 -0
- package/src/advanced/WebXRRenderer.js +680 -0
- package/src/agent/cli/AgentCLI.js +615 -0
- package/src/agent/cli/index.js +14 -0
- package/src/agent/index.js +73 -0
- package/src/agent/mcp/MCPServer.js +950 -0
- package/src/agent/mcp/index.js +9 -0
- package/src/agent/mcp/tools.js +548 -0
- package/src/agent/telemetry/EventStream.js +669 -0
- package/src/agent/telemetry/Instrumentation.js +618 -0
- package/src/agent/telemetry/TelemetryExporters.js +427 -0
- package/src/agent/telemetry/TelemetryService.js +464 -0
- package/src/agent/telemetry/index.js +52 -0
- package/src/benchmarks/BenchmarkRunner.js +381 -0
- package/src/benchmarks/MetricsCollector.js +299 -0
- package/src/benchmarks/index.js +9 -0
- package/src/benchmarks/scenes.js +259 -0
- package/src/cli/index.js +675 -0
- package/src/config/ApiConfig.js +88 -0
- package/src/core/CanvasManager.js +217 -0
- package/src/core/ErrorReporter.js +117 -0
- package/src/core/ParameterMapper.js +333 -0
- package/src/core/Parameters.js +396 -0
- package/src/core/RendererContracts.js +200 -0
- package/src/core/UnifiedResourceManager.js +370 -0
- package/src/core/VIB3Engine.js +636 -0
- package/src/core/renderers/FacetedRendererAdapter.js +32 -0
- package/src/core/renderers/HolographicRendererAdapter.js +29 -0
- package/src/core/renderers/QuantumRendererAdapter.js +29 -0
- package/src/core/renderers/RendererLifecycleManager.js +63 -0
- package/src/creative/ColorPresetsSystem.js +980 -0
- package/src/creative/ParameterTimeline.js +1061 -0
- package/src/creative/PostProcessingPipeline.js +1113 -0
- package/src/creative/TransitionAnimator.js +683 -0
- package/src/export/CSSExporter.js +226 -0
- package/src/export/CardGeneratorBase.js +279 -0
- package/src/export/ExportManager.js +580 -0
- package/src/export/FacetedCardGenerator.js +279 -0
- package/src/export/HolographicCardGenerator.js +543 -0
- package/src/export/LottieExporter.js +552 -0
- package/src/export/QuantumCardGenerator.js +315 -0
- package/src/export/SVGExporter.js +519 -0
- package/src/export/ShaderExporter.js +903 -0
- package/src/export/TradingCardGenerator.js +3055 -0
- package/src/export/TradingCardManager.js +181 -0
- package/src/export/VIB3PackageExporter.js +559 -0
- package/src/export/index.js +14 -0
- package/src/export/systems/TradingCardSystemFaceted.js +494 -0
- package/src/export/systems/TradingCardSystemHolographic.js +452 -0
- package/src/export/systems/TradingCardSystemQuantum.js +411 -0
- package/src/faceted/FacetedSystem.js +963 -0
- package/src/features/CollectionManager.js +433 -0
- package/src/gallery/CollectionManager.js +240 -0
- package/src/gallery/GallerySystem.js +485 -0
- package/src/geometry/GeometryFactory.js +314 -0
- package/src/geometry/GeometryLibrary.js +72 -0
- package/src/geometry/buffers/BufferBuilder.js +338 -0
- package/src/geometry/buffers/index.js +18 -0
- package/src/geometry/generators/Crystal.js +420 -0
- package/src/geometry/generators/Fractal.js +298 -0
- package/src/geometry/generators/KleinBottle.js +197 -0
- package/src/geometry/generators/Sphere.js +192 -0
- package/src/geometry/generators/Tesseract.js +160 -0
- package/src/geometry/generators/Tetrahedron.js +225 -0
- package/src/geometry/generators/Torus.js +304 -0
- package/src/geometry/generators/Wave.js +341 -0
- package/src/geometry/index.js +142 -0
- package/src/geometry/warp/HypersphereCore.js +211 -0
- package/src/geometry/warp/HypertetraCore.js +386 -0
- package/src/geometry/warp/index.js +57 -0
- package/src/holograms/HolographicVisualizer.js +1073 -0
- package/src/holograms/RealHolographicSystem.js +966 -0
- package/src/holograms/variantRegistry.js +69 -0
- package/src/integrations/FigmaPlugin.js +854 -0
- package/src/integrations/OBSMode.js +754 -0
- package/src/integrations/ThreeJsPackage.js +660 -0
- package/src/integrations/TouchDesignerExport.js +552 -0
- package/src/integrations/frameworks/Vib3React.js +591 -0
- package/src/integrations/frameworks/Vib3Svelte.js +654 -0
- package/src/integrations/frameworks/Vib3Vue.js +628 -0
- package/src/llm/LLMParameterInterface.js +240 -0
- package/src/llm/LLMParameterUI.js +577 -0
- package/src/math/Mat4x4.js +708 -0
- package/src/math/Projection.js +341 -0
- package/src/math/Rotor4D.js +637 -0
- package/src/math/Vec4.js +476 -0
- package/src/math/constants.js +164 -0
- package/src/math/index.js +68 -0
- package/src/math/projections.js +54 -0
- package/src/math/rotations.js +196 -0
- package/src/quantum/QuantumEngine.js +906 -0
- package/src/quantum/QuantumVisualizer.js +1103 -0
- package/src/reactivity/ReactivityConfig.js +499 -0
- package/src/reactivity/ReactivityManager.js +586 -0
- package/src/reactivity/SpatialInputSystem.js +1783 -0
- package/src/reactivity/index.js +93 -0
- package/src/render/CommandBuffer.js +465 -0
- package/src/render/MultiCanvasBridge.js +340 -0
- package/src/render/RenderCommand.js +514 -0
- package/src/render/RenderResourceRegistry.js +523 -0
- package/src/render/RenderState.js +552 -0
- package/src/render/RenderTarget.js +512 -0
- package/src/render/ShaderLoader.js +253 -0
- package/src/render/ShaderProgram.js +599 -0
- package/src/render/UnifiedRenderBridge.js +496 -0
- package/src/render/backends/WebGLBackend.js +1108 -0
- package/src/render/backends/WebGPUBackend.js +1409 -0
- package/src/render/commands/CommandBufferExecutor.js +607 -0
- package/src/render/commands/RenderCommandBuffer.js +661 -0
- package/src/render/commands/index.js +17 -0
- package/src/render/index.js +367 -0
- package/src/scene/Disposable.js +498 -0
- package/src/scene/MemoryPool.js +618 -0
- package/src/scene/Node4D.js +697 -0
- package/src/scene/ResourceManager.js +599 -0
- package/src/scene/Scene4D.js +540 -0
- package/src/scene/index.js +98 -0
- package/src/schemas/error.schema.json +84 -0
- package/src/schemas/extension.schema.json +88 -0
- package/src/schemas/index.js +214 -0
- package/src/schemas/parameters.schema.json +142 -0
- package/src/schemas/tool-pack.schema.json +44 -0
- package/src/schemas/tool-response.schema.json +127 -0
- package/src/shaders/common/fullscreen.vert.glsl +5 -0
- package/src/shaders/common/fullscreen.vert.wgsl +17 -0
- package/src/shaders/common/geometry24.glsl +65 -0
- package/src/shaders/common/geometry24.wgsl +54 -0
- package/src/shaders/common/rotation4d.glsl +85 -0
- package/src/shaders/common/rotation4d.wgsl +86 -0
- package/src/shaders/common/uniforms.glsl +44 -0
- package/src/shaders/common/uniforms.wgsl +48 -0
- package/src/shaders/faceted/faceted.frag.glsl +129 -0
- package/src/shaders/faceted/faceted.frag.wgsl +164 -0
- package/src/shaders/holographic/holographic.frag.glsl +406 -0
- package/src/shaders/holographic/holographic.frag.wgsl +185 -0
- package/src/shaders/quantum/quantum.frag.glsl +513 -0
- package/src/shaders/quantum/quantum.frag.wgsl +361 -0
- package/src/testing/ParallelTestFramework.js +519 -0
- package/src/testing/__snapshots__/exportFormats.test.js.snap +24 -0
- package/src/testing/exportFormats.test.js +8 -0
- package/src/testing/projections.test.js +14 -0
- package/src/testing/rotations.test.js +37 -0
- package/src/ui/InteractivityMenu.js +516 -0
- package/src/ui/StatusManager.js +96 -0
- package/src/ui/adaptive/renderers/webgpu/BufferLayout.ts +252 -0
- package/src/ui/adaptive/renderers/webgpu/PolytopeInstanceBuffer.ts +144 -0
- package/src/ui/adaptive/renderers/webgpu/TripleBufferedUniform.ts +170 -0
- package/src/ui/adaptive/renderers/webgpu/WebGPURenderer.ts +735 -0
- package/src/ui/adaptive/renderers/webgpu/index.ts +112 -0
- package/src/variations/VariationManager.js +431 -0
- package/src/viewer/AudioReactivity.js +505 -0
- package/src/viewer/CardBending.js +481 -0
- package/src/viewer/GalleryUI.js +832 -0
- package/src/viewer/ReactivityManager.js +590 -0
- package/src/viewer/TradingCardExporter.js +600 -0
- package/src/viewer/ViewerPortal.js +374 -0
- package/src/viewer/index.js +12 -0
- package/src/wasm/WasmLoader.js +296 -0
- package/src/wasm/index.js +132 -0
- package/tools/agentic/mcpTools.js +88 -0
- package/tools/cli/agent-cli.js +92 -0
- package/tools/export/formats.js +24 -0
- package/tools/math/rotation-baseline.mjs +64 -0
- package/tools/shader-sync-verify.js +937 -0
- package/tools/telemetry/manifestPipeline.js +141 -0
- package/tools/telemetry/telemetryEvents.js +35 -0
- package/types/adaptive-sdk.d.ts +185 -0
- package/types/advanced/AIPresetGenerator.d.ts +81 -0
- package/types/advanced/MIDIController.d.ts +100 -0
- package/types/advanced/OffscreenWorker.d.ts +82 -0
- package/types/advanced/WebGPUCompute.d.ts +52 -0
- package/types/advanced/WebXRRenderer.d.ts +77 -0
- package/types/advanced/index.d.ts +46 -0
- package/types/core/ErrorReporter.d.ts +50 -0
- package/types/core/VIB3Engine.d.ts +204 -0
- package/types/creative/ColorPresetsSystem.d.ts +91 -0
- package/types/creative/ParameterTimeline.d.ts +74 -0
- package/types/creative/PostProcessingPipeline.d.ts +109 -0
- package/types/creative/TransitionAnimator.d.ts +71 -0
- package/types/creative/index.d.ts +35 -0
- package/types/integrations/FigmaPlugin.d.ts +46 -0
- package/types/integrations/OBSMode.d.ts +74 -0
- package/types/integrations/ThreeJsPackage.d.ts +62 -0
- package/types/integrations/TouchDesignerExport.d.ts +36 -0
- package/types/integrations/Vib3React.d.ts +74 -0
- package/types/integrations/Vib3Svelte.d.ts +63 -0
- package/types/integrations/Vib3Vue.d.ts +55 -0
- package/types/integrations/index.d.ts +52 -0
- package/types/reactivity/SpatialInputSystem.d.ts +173 -0
- package/types/reactivity/index.d.ts +394 -0
- package/types/render/CommandBuffer.d.ts +169 -0
- package/types/render/RenderCommand.d.ts +312 -0
- package/types/render/RenderState.d.ts +279 -0
- package/types/render/RenderTarget.d.ts +254 -0
- package/types/render/ShaderProgram.d.ts +277 -0
- package/types/render/UnifiedRenderBridge.d.ts +143 -0
- package/types/render/WebGLBackend.d.ts +168 -0
- package/types/render/WebGPUBackend.d.ts +186 -0
- package/types/render/index.d.ts +141 -0
|
@@ -0,0 +1,702 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
|
6
|
+
<title>VIB3+ Live — Quantum | Faceted | Holographic</title>
|
|
7
|
+
<style>
|
|
8
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
9
|
+
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; }
|
|
10
|
+
canvas {
|
|
11
|
+
display: block;
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 100%;
|
|
14
|
+
position: fixed;
|
|
15
|
+
top: 0; left: 0;
|
|
16
|
+
z-index: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* HUD overlay */
|
|
20
|
+
#hud {
|
|
21
|
+
position: fixed;
|
|
22
|
+
top: 12px; left: 12px;
|
|
23
|
+
z-index: 10;
|
|
24
|
+
font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
|
|
25
|
+
font-size: 11px;
|
|
26
|
+
color: rgba(255,255,255,0.7);
|
|
27
|
+
pointer-events: none;
|
|
28
|
+
user-select: none;
|
|
29
|
+
}
|
|
30
|
+
#hud .backend-badge {
|
|
31
|
+
display: inline-block;
|
|
32
|
+
padding: 3px 10px;
|
|
33
|
+
border-radius: 4px;
|
|
34
|
+
font-size: 10px;
|
|
35
|
+
font-weight: bold;
|
|
36
|
+
letter-spacing: 2px;
|
|
37
|
+
text-transform: uppercase;
|
|
38
|
+
margin-bottom: 6px;
|
|
39
|
+
}
|
|
40
|
+
#hud .backend-badge.webgpu {
|
|
41
|
+
background: rgba(0,255,100,0.2);
|
|
42
|
+
color: #0f6;
|
|
43
|
+
border: 1px solid rgba(0,255,100,0.4);
|
|
44
|
+
}
|
|
45
|
+
#hud .backend-badge.webgl {
|
|
46
|
+
background: rgba(255,200,0,0.2);
|
|
47
|
+
color: #fc0;
|
|
48
|
+
border: 1px solid rgba(255,200,0,0.4);
|
|
49
|
+
}
|
|
50
|
+
#hud .backend-badge.error {
|
|
51
|
+
background: rgba(255,50,50,0.2);
|
|
52
|
+
color: #f44;
|
|
53
|
+
border: 1px solid rgba(255,50,50,0.4);
|
|
54
|
+
}
|
|
55
|
+
#hud .info-line {
|
|
56
|
+
opacity: 0.6;
|
|
57
|
+
line-height: 1.6;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* System selector tabs */
|
|
61
|
+
#system-tabs {
|
|
62
|
+
position: fixed;
|
|
63
|
+
top: 12px;
|
|
64
|
+
left: 50%;
|
|
65
|
+
transform: translateX(-50%);
|
|
66
|
+
z-index: 20;
|
|
67
|
+
display: flex;
|
|
68
|
+
gap: 4px;
|
|
69
|
+
font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
|
|
70
|
+
}
|
|
71
|
+
#system-tabs button {
|
|
72
|
+
padding: 6px 16px;
|
|
73
|
+
background: rgba(10,10,20,0.7);
|
|
74
|
+
border: 1px solid rgba(255,255,255,0.15);
|
|
75
|
+
border-radius: 6px;
|
|
76
|
+
color: rgba(255,255,255,0.5);
|
|
77
|
+
font-family: inherit;
|
|
78
|
+
font-size: 10px;
|
|
79
|
+
font-weight: bold;
|
|
80
|
+
letter-spacing: 2px;
|
|
81
|
+
text-transform: uppercase;
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
transition: all 0.2s ease;
|
|
84
|
+
backdrop-filter: blur(8px);
|
|
85
|
+
-webkit-backdrop-filter: blur(8px);
|
|
86
|
+
}
|
|
87
|
+
#system-tabs button:hover {
|
|
88
|
+
background: rgba(30,30,50,0.85);
|
|
89
|
+
color: rgba(255,255,255,0.8);
|
|
90
|
+
}
|
|
91
|
+
#system-tabs button.active-quantum {
|
|
92
|
+
background: rgba(255,50,50,0.2);
|
|
93
|
+
border-color: rgba(255,100,50,0.6);
|
|
94
|
+
color: #f64;
|
|
95
|
+
}
|
|
96
|
+
#system-tabs button.active-faceted {
|
|
97
|
+
background: rgba(0,255,255,0.15);
|
|
98
|
+
border-color: rgba(0,255,255,0.5);
|
|
99
|
+
color: #0ff;
|
|
100
|
+
}
|
|
101
|
+
#system-tabs button.active-holographic {
|
|
102
|
+
background: rgba(200,0,255,0.15);
|
|
103
|
+
border-color: rgba(200,100,255,0.5);
|
|
104
|
+
color: #c8f;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* Controls panel */
|
|
108
|
+
#controls {
|
|
109
|
+
position: fixed;
|
|
110
|
+
top: 12px; right: 12px;
|
|
111
|
+
z-index: 20;
|
|
112
|
+
font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
|
|
113
|
+
font-size: 11px;
|
|
114
|
+
color: #e0e0e0;
|
|
115
|
+
background: rgba(10,10,20,0.85);
|
|
116
|
+
border: 1px solid rgba(255,255,255,0.1);
|
|
117
|
+
border-radius: 10px;
|
|
118
|
+
padding: 16px;
|
|
119
|
+
width: 280px;
|
|
120
|
+
max-height: calc(100vh - 24px);
|
|
121
|
+
overflow-y: auto;
|
|
122
|
+
backdrop-filter: blur(10px);
|
|
123
|
+
-webkit-backdrop-filter: blur(10px);
|
|
124
|
+
transition: transform 0.3s ease, opacity 0.3s ease;
|
|
125
|
+
}
|
|
126
|
+
#controls.hidden {
|
|
127
|
+
transform: translateX(300px);
|
|
128
|
+
opacity: 0;
|
|
129
|
+
pointer-events: none;
|
|
130
|
+
}
|
|
131
|
+
#controls h3 {
|
|
132
|
+
color: #0ff;
|
|
133
|
+
font-size: 10px;
|
|
134
|
+
letter-spacing: 2px;
|
|
135
|
+
text-transform: uppercase;
|
|
136
|
+
margin: 12px 0 6px;
|
|
137
|
+
padding-bottom: 4px;
|
|
138
|
+
border-bottom: 1px solid rgba(255,255,255,0.1);
|
|
139
|
+
}
|
|
140
|
+
#controls h3:first-child { margin-top: 0; }
|
|
141
|
+
#controls label {
|
|
142
|
+
display: flex;
|
|
143
|
+
justify-content: space-between;
|
|
144
|
+
align-items: center;
|
|
145
|
+
margin: 4px 0;
|
|
146
|
+
color: #999;
|
|
147
|
+
}
|
|
148
|
+
#controls label span.val {
|
|
149
|
+
color: #0f6;
|
|
150
|
+
font-weight: bold;
|
|
151
|
+
min-width: 50px;
|
|
152
|
+
text-align: right;
|
|
153
|
+
}
|
|
154
|
+
#controls input[type="range"] {
|
|
155
|
+
width: 100%;
|
|
156
|
+
margin: 2px 0 8px;
|
|
157
|
+
accent-color: #0ff;
|
|
158
|
+
height: 4px;
|
|
159
|
+
}
|
|
160
|
+
#controls select {
|
|
161
|
+
width: 100%;
|
|
162
|
+
padding: 6px 8px;
|
|
163
|
+
background: rgba(0,0,0,0.5);
|
|
164
|
+
color: #0ff;
|
|
165
|
+
border: 1px solid rgba(0,255,255,0.3);
|
|
166
|
+
border-radius: 4px;
|
|
167
|
+
font-family: inherit;
|
|
168
|
+
font-size: 11px;
|
|
169
|
+
margin: 4px 0 8px;
|
|
170
|
+
}
|
|
171
|
+
#controls button {
|
|
172
|
+
width: 100%;
|
|
173
|
+
padding: 8px;
|
|
174
|
+
background: rgba(0,255,255,0.12);
|
|
175
|
+
border: 1px solid rgba(0,255,255,0.3);
|
|
176
|
+
border-radius: 6px;
|
|
177
|
+
color: #0ff;
|
|
178
|
+
font-family: inherit;
|
|
179
|
+
font-size: 11px;
|
|
180
|
+
cursor: pointer;
|
|
181
|
+
margin: 4px 0;
|
|
182
|
+
letter-spacing: 1px;
|
|
183
|
+
}
|
|
184
|
+
#controls button:active {
|
|
185
|
+
background: rgba(0,255,255,0.3);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* Toggle button */
|
|
189
|
+
#toggle-controls {
|
|
190
|
+
position: fixed;
|
|
191
|
+
top: 12px; right: 12px;
|
|
192
|
+
z-index: 30;
|
|
193
|
+
width: 36px; height: 36px;
|
|
194
|
+
background: rgba(10,10,20,0.85);
|
|
195
|
+
border: 1px solid rgba(255,255,255,0.2);
|
|
196
|
+
border-radius: 8px;
|
|
197
|
+
color: #0ff;
|
|
198
|
+
font-size: 18px;
|
|
199
|
+
display: flex;
|
|
200
|
+
align-items: center;
|
|
201
|
+
justify-content: center;
|
|
202
|
+
cursor: pointer;
|
|
203
|
+
backdrop-filter: blur(10px);
|
|
204
|
+
-webkit-backdrop-filter: blur(10px);
|
|
205
|
+
transition: opacity 0.3s;
|
|
206
|
+
}
|
|
207
|
+
#toggle-controls.panel-open {
|
|
208
|
+
opacity: 0;
|
|
209
|
+
pointer-events: none;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* Bottom bar */
|
|
213
|
+
#bottom-bar {
|
|
214
|
+
position: fixed;
|
|
215
|
+
bottom: 12px;
|
|
216
|
+
left: 50%;
|
|
217
|
+
transform: translateX(-50%);
|
|
218
|
+
z-index: 10;
|
|
219
|
+
font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
|
|
220
|
+
font-size: 10px;
|
|
221
|
+
color: rgba(255,255,255,0.4);
|
|
222
|
+
text-align: center;
|
|
223
|
+
pointer-events: none;
|
|
224
|
+
user-select: none;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* Scrollbar styling */
|
|
228
|
+
#controls::-webkit-scrollbar { width: 4px; }
|
|
229
|
+
#controls::-webkit-scrollbar-track { background: transparent; }
|
|
230
|
+
#controls::-webkit-scrollbar-thumb { background: rgba(0,255,255,0.3); border-radius: 2px; }
|
|
231
|
+
</style>
|
|
232
|
+
</head>
|
|
233
|
+
<body>
|
|
234
|
+
<!-- Canvases for each system -->
|
|
235
|
+
<canvas id="quantum-canvas" style="display:none;"></canvas>
|
|
236
|
+
<canvas id="faceted-canvas" style="display:none;"></canvas>
|
|
237
|
+
<canvas id="holographic-canvas" style="display:none;"></canvas>
|
|
238
|
+
|
|
239
|
+
<div id="hud">
|
|
240
|
+
<div id="backend-badge" class="backend-badge">INITIALIZING</div>
|
|
241
|
+
<div class="info-line" id="hud-system">System: --</div>
|
|
242
|
+
<div class="info-line" id="hud-geo">Geometry: --</div>
|
|
243
|
+
<div class="info-line" id="hud-fps">FPS: --</div>
|
|
244
|
+
</div>
|
|
245
|
+
|
|
246
|
+
<div id="system-tabs">
|
|
247
|
+
<button id="tab-quantum" onclick="switchSystem('quantum')">1 Quantum</button>
|
|
248
|
+
<button id="tab-faceted" onclick="switchSystem('faceted')">2 Faceted</button>
|
|
249
|
+
<button id="tab-holographic" onclick="switchSystem('holographic')">3 Holographic</button>
|
|
250
|
+
</div>
|
|
251
|
+
|
|
252
|
+
<div id="toggle-controls" onclick="togglePanel()">☰</div>
|
|
253
|
+
|
|
254
|
+
<div id="controls" class="hidden">
|
|
255
|
+
<h3>Geometry</h3>
|
|
256
|
+
<select id="geo-select"></select>
|
|
257
|
+
|
|
258
|
+
<h3>6D Rotation</h3>
|
|
259
|
+
<label>XY <span class="val" id="val-xy">0.00</span></label>
|
|
260
|
+
<input type="range" id="rot-xy" min="0" max="6.283" step="0.01" value="0">
|
|
261
|
+
<label>XZ <span class="val" id="val-xz">0.00</span></label>
|
|
262
|
+
<input type="range" id="rot-xz" min="0" max="6.283" step="0.01" value="0">
|
|
263
|
+
<label>YZ <span class="val" id="val-yz">0.00</span></label>
|
|
264
|
+
<input type="range" id="rot-yz" min="0" max="6.283" step="0.01" value="0">
|
|
265
|
+
<label>XW (4D) <span class="val" id="val-xw">0.00</span></label>
|
|
266
|
+
<input type="range" id="rot-xw" min="0" max="6.283" step="0.01" value="0">
|
|
267
|
+
<label>YW (4D) <span class="val" id="val-yw">0.00</span></label>
|
|
268
|
+
<input type="range" id="rot-yw" min="0" max="6.283" step="0.01" value="0">
|
|
269
|
+
<label>ZW (4D) <span class="val" id="val-zw">0.00</span></label>
|
|
270
|
+
<input type="range" id="rot-zw" min="0" max="6.283" step="0.01" value="0">
|
|
271
|
+
|
|
272
|
+
<h3>Visual Parameters</h3>
|
|
273
|
+
<label>Grid Density <span class="val" id="val-grid">15</span></label>
|
|
274
|
+
<input type="range" id="param-grid" min="4" max="100" step="1" value="15">
|
|
275
|
+
<label>Morph Factor <span class="val" id="val-morph">1.00</span></label>
|
|
276
|
+
<input type="range" id="param-morph" min="0" max="2" step="0.01" value="1.0">
|
|
277
|
+
<label>Chaos <span class="val" id="val-chaos">0.20</span></label>
|
|
278
|
+
<input type="range" id="param-chaos" min="0" max="1" step="0.01" value="0.2">
|
|
279
|
+
<label>Speed <span class="val" id="val-speed">1.00</span></label>
|
|
280
|
+
<input type="range" id="param-speed" min="0.1" max="3" step="0.01" value="1.0">
|
|
281
|
+
<label>Hue <span class="val" id="val-hue">200</span></label>
|
|
282
|
+
<input type="range" id="param-hue" min="0" max="360" step="1" value="200">
|
|
283
|
+
<label>Intensity <span class="val" id="val-int">0.70</span></label>
|
|
284
|
+
<input type="range" id="param-int" min="0" max="1" step="0.01" value="0.7">
|
|
285
|
+
<label>Dimension <span class="val" id="val-dim">3.50</span></label>
|
|
286
|
+
<input type="range" id="param-dim" min="3" max="4.5" step="0.01" value="3.5">
|
|
287
|
+
|
|
288
|
+
<h3>Actions</h3>
|
|
289
|
+
<button onclick="randomizeAll()">Randomize All</button>
|
|
290
|
+
<button onclick="resetDefaults()">Reset Defaults</button>
|
|
291
|
+
<button onclick="toggleAutoRotate()">Toggle Auto-Rotate</button>
|
|
292
|
+
<button onclick="togglePanel()">Close Panel</button>
|
|
293
|
+
</div>
|
|
294
|
+
|
|
295
|
+
<div id="bottom-bar">
|
|
296
|
+
VIB3+ CORE — <kbd>1</kbd> Quantum • <kbd>2</kbd> Faceted • <kbd>3</kbd> Holographic • <kbd>C</kbd> controls • <kbd>R</kbd> randomize • <kbd>Space</kbd> auto-rotate
|
|
297
|
+
</div>
|
|
298
|
+
|
|
299
|
+
<script type="module">
|
|
300
|
+
import { FacetedSystem } from '../src/faceted/FacetedSystem.js';
|
|
301
|
+
import { QuantumHolographicVisualizer } from '../src/quantum/QuantumVisualizer.js';
|
|
302
|
+
import { HolographicVisualizer } from '../src/holograms/HolographicVisualizer.js';
|
|
303
|
+
|
|
304
|
+
// ---- State ----
|
|
305
|
+
let activeSystem = 'faceted'; // default
|
|
306
|
+
let faceted = null;
|
|
307
|
+
let quantum = null;
|
|
308
|
+
let holographic = null;
|
|
309
|
+
let backendType = 'unknown';
|
|
310
|
+
let autoRotate = true;
|
|
311
|
+
let frameCount = 0;
|
|
312
|
+
let lastFPSTime = performance.now();
|
|
313
|
+
let fps = 0;
|
|
314
|
+
|
|
315
|
+
const GEOMETRY_NAMES = [
|
|
316
|
+
'Tetrahedron', 'Hypercube', 'Sphere', 'Torus',
|
|
317
|
+
'Klein Bottle', 'Fractal', 'Wave', 'Crystal',
|
|
318
|
+
'Hypersphere (Tetra)', 'Hypersphere (Cube)', 'Hypersphere (Sphere)', 'Hypersphere (Torus)',
|
|
319
|
+
'Hypersphere (Klein)', 'Hypersphere (Fractal)', 'Hypersphere (Wave)', 'Hypersphere (Crystal)',
|
|
320
|
+
'Hypertetra (Tetra)', 'Hypertetra (Cube)', 'Hypertetra (Sphere)', 'Hypertetra (Torus)',
|
|
321
|
+
'Hypertetra (Klein)', 'Hypertetra (Fractal)', 'Hypertetra (Wave)', 'Hypertetra (Crystal)'
|
|
322
|
+
];
|
|
323
|
+
|
|
324
|
+
// Shared parameters across all systems
|
|
325
|
+
const params = {
|
|
326
|
+
geometry: 0,
|
|
327
|
+
rot4dXY: 0, rot4dXZ: 0, rot4dYZ: 0,
|
|
328
|
+
rot4dXW: 0, rot4dYW: 0, rot4dZW: 0,
|
|
329
|
+
gridDensity: 15,
|
|
330
|
+
morphFactor: 1.0,
|
|
331
|
+
chaos: 0.2,
|
|
332
|
+
speed: 1.0,
|
|
333
|
+
hue: 200,
|
|
334
|
+
intensity: 0.7,
|
|
335
|
+
dimension: 3.5
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
// ---- Populate geometry selector ----
|
|
339
|
+
const geoSelect = document.getElementById('geo-select');
|
|
340
|
+
GEOMETRY_NAMES.forEach((name, i) => {
|
|
341
|
+
const opt = document.createElement('option');
|
|
342
|
+
opt.value = i;
|
|
343
|
+
opt.textContent = `${i}: ${name}`;
|
|
344
|
+
geoSelect.appendChild(opt);
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
// ---- Canvas management ----
|
|
348
|
+
function getCanvasForSystem(sys) {
|
|
349
|
+
return document.getElementById(sys + '-canvas');
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function showCanvas(sys) {
|
|
353
|
+
['quantum', 'faceted', 'holographic'].forEach(s => {
|
|
354
|
+
getCanvasForSystem(s).style.display = (s === sys) ? 'block' : 'none';
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
function resizeCanvas(canvas) {
|
|
359
|
+
const dpr = window.devicePixelRatio || 1;
|
|
360
|
+
canvas.width = window.innerWidth * dpr;
|
|
361
|
+
canvas.height = window.innerHeight * dpr;
|
|
362
|
+
canvas.style.width = window.innerWidth + 'px';
|
|
363
|
+
canvas.style.height = window.innerHeight + 'px';
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
function resizeAll() {
|
|
367
|
+
['quantum', 'faceted', 'holographic'].forEach(s => {
|
|
368
|
+
resizeCanvas(getCanvasForSystem(s));
|
|
369
|
+
});
|
|
370
|
+
if (faceted && faceted._renderMode === 'bridge' && faceted._bridge) {
|
|
371
|
+
faceted._bridge.resize(window.innerWidth, window.innerHeight, window.devicePixelRatio || 1);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// ---- Initialize all systems ----
|
|
376
|
+
async function init() {
|
|
377
|
+
const badge = document.getElementById('backend-badge');
|
|
378
|
+
resizeAll();
|
|
379
|
+
window.addEventListener('resize', resizeAll);
|
|
380
|
+
|
|
381
|
+
// --- Faceted System (supports WebGPU bridge) ---
|
|
382
|
+
const facetedCanvas = getCanvasForSystem('faceted');
|
|
383
|
+
faceted = new FacetedSystem();
|
|
384
|
+
try {
|
|
385
|
+
const success = await faceted.initWithBridge(facetedCanvas, {
|
|
386
|
+
preferWebGPU: true,
|
|
387
|
+
debug: true
|
|
388
|
+
});
|
|
389
|
+
if (success) {
|
|
390
|
+
backendType = faceted.getBackendType();
|
|
391
|
+
} else {
|
|
392
|
+
throw new Error('Bridge init returned false');
|
|
393
|
+
}
|
|
394
|
+
} catch (err) {
|
|
395
|
+
console.warn('Faceted bridge init failed, trying direct WebGL:', err);
|
|
396
|
+
faceted = new FacetedSystem();
|
|
397
|
+
faceted.initialize(facetedCanvas);
|
|
398
|
+
backendType = 'webgl';
|
|
399
|
+
}
|
|
400
|
+
faceted.setActive(true);
|
|
401
|
+
|
|
402
|
+
// --- Quantum System (direct WebGL) ---
|
|
403
|
+
const quantumCanvas = getCanvasForSystem('quantum');
|
|
404
|
+
// QuantumHolographicVisualizer expects a canvas ID
|
|
405
|
+
quantumCanvas.id = 'quantum-canvas';
|
|
406
|
+
try {
|
|
407
|
+
quantum = new QuantumHolographicVisualizer('quantum-canvas', 'content', 1.0, 0);
|
|
408
|
+
console.log('Quantum system initialized');
|
|
409
|
+
} catch (err) {
|
|
410
|
+
console.error('Quantum init failed:', err);
|
|
411
|
+
quantum = null;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// --- Holographic System (direct WebGL) ---
|
|
415
|
+
const holoCanvas = getCanvasForSystem('holographic');
|
|
416
|
+
holoCanvas.id = 'holographic-canvas';
|
|
417
|
+
try {
|
|
418
|
+
holographic = new HolographicVisualizer('holographic-canvas', 'content', 1.0, 0);
|
|
419
|
+
console.log('Holographic system initialized');
|
|
420
|
+
} catch (err) {
|
|
421
|
+
console.error('Holographic init failed:', err);
|
|
422
|
+
holographic = null;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// Set initial system
|
|
426
|
+
switchSystem('faceted');
|
|
427
|
+
|
|
428
|
+
badge.textContent = backendType.toUpperCase();
|
|
429
|
+
badge.className = 'backend-badge ' + (backendType === 'webgpu' ? 'webgpu' : 'webgl');
|
|
430
|
+
console.log(`VIB3+ Live: Initialized on ${backendType}`);
|
|
431
|
+
|
|
432
|
+
requestAnimationFrame(loop);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
// ---- System switching ----
|
|
436
|
+
window.switchSystem = function(sys) {
|
|
437
|
+
activeSystem = sys;
|
|
438
|
+
showCanvas(sys);
|
|
439
|
+
|
|
440
|
+
// Update tab styling
|
|
441
|
+
document.getElementById('tab-quantum').className = sys === 'quantum' ? 'active-quantum' : '';
|
|
442
|
+
document.getElementById('tab-faceted').className = sys === 'faceted' ? 'active-faceted' : '';
|
|
443
|
+
document.getElementById('tab-holographic').className = sys === 'holographic' ? 'active-holographic' : '';
|
|
444
|
+
|
|
445
|
+
document.getElementById('hud-system').textContent = `System: ${sys.charAt(0).toUpperCase() + sys.slice(1)}`;
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
// ---- Push params to active system ----
|
|
449
|
+
function syncParamsToSystem() {
|
|
450
|
+
if (activeSystem === 'faceted' && faceted) {
|
|
451
|
+
Object.assign(faceted.parameters, params);
|
|
452
|
+
} else if (activeSystem === 'quantum' && quantum) {
|
|
453
|
+
quantum.updateParameters(params);
|
|
454
|
+
} else if (activeSystem === 'holographic' && holographic) {
|
|
455
|
+
holographic.updateParameters(params);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// ---- Render loop ----
|
|
460
|
+
function loop(now) {
|
|
461
|
+
// Auto-rotate 4D planes
|
|
462
|
+
if (autoRotate) {
|
|
463
|
+
const t = now * 0.0003;
|
|
464
|
+
params.rot4dXW = Math.sin(t * 0.7) * 3.14;
|
|
465
|
+
params.rot4dYW = Math.cos(t * 0.5) * 3.14;
|
|
466
|
+
params.rot4dZW = Math.sin(t * 0.3) * 3.14;
|
|
467
|
+
|
|
468
|
+
document.getElementById('rot-xw').value = params.rot4dXW;
|
|
469
|
+
document.getElementById('rot-yw').value = params.rot4dYW;
|
|
470
|
+
document.getElementById('rot-zw').value = params.rot4dZW;
|
|
471
|
+
document.getElementById('val-xw').textContent = params.rot4dXW.toFixed(2);
|
|
472
|
+
document.getElementById('val-yw').textContent = params.rot4dYW.toFixed(2);
|
|
473
|
+
document.getElementById('val-zw').textContent = params.rot4dZW.toFixed(2);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
syncParamsToSystem();
|
|
477
|
+
|
|
478
|
+
// Render active system
|
|
479
|
+
if (activeSystem === 'faceted' && faceted) {
|
|
480
|
+
faceted.renderFrame();
|
|
481
|
+
} else if (activeSystem === 'quantum' && quantum) {
|
|
482
|
+
quantum.render();
|
|
483
|
+
} else if (activeSystem === 'holographic' && holographic) {
|
|
484
|
+
holographic.render();
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// FPS counter
|
|
488
|
+
frameCount++;
|
|
489
|
+
if (now - lastFPSTime >= 1000) {
|
|
490
|
+
fps = frameCount;
|
|
491
|
+
frameCount = 0;
|
|
492
|
+
lastFPSTime = now;
|
|
493
|
+
document.getElementById('hud-fps').textContent = `FPS: ${fps}`;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
// Update geometry HUD
|
|
497
|
+
const geoIdx = params.geometry;
|
|
498
|
+
document.getElementById('hud-geo').textContent =
|
|
499
|
+
`Geometry: ${geoIdx} (${GEOMETRY_NAMES[geoIdx] || '?'})`;
|
|
500
|
+
|
|
501
|
+
requestAnimationFrame(loop);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// ---- Controls binding ----
|
|
505
|
+
geoSelect.addEventListener('change', (e) => {
|
|
506
|
+
params.geometry = parseInt(e.target.value);
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
// Rotation sliders
|
|
510
|
+
const rotMap = {
|
|
511
|
+
'rot-xy': ['rot4dXY', 'val-xy'],
|
|
512
|
+
'rot-xz': ['rot4dXZ', 'val-xz'],
|
|
513
|
+
'rot-yz': ['rot4dYZ', 'val-yz'],
|
|
514
|
+
'rot-xw': ['rot4dXW', 'val-xw'],
|
|
515
|
+
'rot-yw': ['rot4dYW', 'val-yw'],
|
|
516
|
+
'rot-zw': ['rot4dZW', 'val-zw']
|
|
517
|
+
};
|
|
518
|
+
Object.entries(rotMap).forEach(([sliderId, [paramKey, valId]]) => {
|
|
519
|
+
const slider = document.getElementById(sliderId);
|
|
520
|
+
slider.addEventListener('input', () => {
|
|
521
|
+
params[paramKey] = parseFloat(slider.value);
|
|
522
|
+
document.getElementById(valId).textContent = parseFloat(slider.value).toFixed(2);
|
|
523
|
+
});
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
// Visual parameter sliders
|
|
527
|
+
const paramMap = {
|
|
528
|
+
'param-grid': ['gridDensity', 'val-grid', 0],
|
|
529
|
+
'param-morph': ['morphFactor', 'val-morph', 2],
|
|
530
|
+
'param-chaos': ['chaos', 'val-chaos', 2],
|
|
531
|
+
'param-speed': ['speed', 'val-speed', 2],
|
|
532
|
+
'param-hue': ['hue', 'val-hue', 0],
|
|
533
|
+
'param-int': ['intensity', 'val-int', 2],
|
|
534
|
+
'param-dim': ['dimension', 'val-dim', 2]
|
|
535
|
+
};
|
|
536
|
+
Object.entries(paramMap).forEach(([sliderId, [paramKey, valId, decimals]]) => {
|
|
537
|
+
const slider = document.getElementById(sliderId);
|
|
538
|
+
slider.addEventListener('input', () => {
|
|
539
|
+
params[paramKey] = parseFloat(slider.value);
|
|
540
|
+
document.getElementById(valId).textContent = parseFloat(slider.value).toFixed(decimals);
|
|
541
|
+
});
|
|
542
|
+
});
|
|
543
|
+
|
|
544
|
+
// ---- Global actions ----
|
|
545
|
+
window.randomizeAll = function() {
|
|
546
|
+
params.geometry = Math.floor(Math.random() * 24);
|
|
547
|
+
params.rot4dXY = Math.random() * 6.283;
|
|
548
|
+
params.rot4dXZ = Math.random() * 6.283;
|
|
549
|
+
params.rot4dYZ = Math.random() * 6.283;
|
|
550
|
+
params.rot4dXW = Math.random() * 6.283;
|
|
551
|
+
params.rot4dYW = Math.random() * 6.283;
|
|
552
|
+
params.rot4dZW = Math.random() * 6.283;
|
|
553
|
+
params.gridDensity = 4 + Math.random() * 96;
|
|
554
|
+
params.morphFactor = Math.random() * 2;
|
|
555
|
+
params.chaos = Math.random();
|
|
556
|
+
params.speed = 0.1 + Math.random() * 2.9;
|
|
557
|
+
params.hue = Math.random() * 360;
|
|
558
|
+
params.intensity = 0.3 + Math.random() * 0.7;
|
|
559
|
+
params.dimension = 3.0 + Math.random() * 1.5;
|
|
560
|
+
syncSlidersFromParams();
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
window.resetDefaults = function() {
|
|
564
|
+
params.geometry = 0;
|
|
565
|
+
params.rot4dXY = 0;
|
|
566
|
+
params.rot4dXZ = 0;
|
|
567
|
+
params.rot4dYZ = 0;
|
|
568
|
+
params.rot4dXW = 0;
|
|
569
|
+
params.rot4dYW = 0;
|
|
570
|
+
params.rot4dZW = 0;
|
|
571
|
+
params.gridDensity = 15;
|
|
572
|
+
params.morphFactor = 1.0;
|
|
573
|
+
params.chaos = 0.2;
|
|
574
|
+
params.speed = 1.0;
|
|
575
|
+
params.hue = 200;
|
|
576
|
+
params.intensity = 0.7;
|
|
577
|
+
params.dimension = 3.5;
|
|
578
|
+
syncSlidersFromParams();
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
window.toggleAutoRotate = function() {
|
|
582
|
+
autoRotate = !autoRotate;
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
window.togglePanel = function() {
|
|
586
|
+
const panel = document.getElementById('controls');
|
|
587
|
+
const btn = document.getElementById('toggle-controls');
|
|
588
|
+
panel.classList.toggle('hidden');
|
|
589
|
+
btn.classList.toggle('panel-open');
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
function syncSlidersFromParams() {
|
|
593
|
+
document.getElementById('geo-select').value = params.geometry;
|
|
594
|
+
document.getElementById('rot-xy').value = params.rot4dXY;
|
|
595
|
+
document.getElementById('rot-xz').value = params.rot4dXZ;
|
|
596
|
+
document.getElementById('rot-yz').value = params.rot4dYZ;
|
|
597
|
+
document.getElementById('rot-xw').value = params.rot4dXW;
|
|
598
|
+
document.getElementById('rot-yw').value = params.rot4dYW;
|
|
599
|
+
document.getElementById('rot-zw').value = params.rot4dZW;
|
|
600
|
+
document.getElementById('param-grid').value = params.gridDensity;
|
|
601
|
+
document.getElementById('param-morph').value = params.morphFactor;
|
|
602
|
+
document.getElementById('param-chaos').value = params.chaos;
|
|
603
|
+
document.getElementById('param-speed').value = params.speed;
|
|
604
|
+
document.getElementById('param-hue').value = params.hue;
|
|
605
|
+
document.getElementById('param-int').value = params.intensity;
|
|
606
|
+
document.getElementById('param-dim').value = params.dimension;
|
|
607
|
+
|
|
608
|
+
document.getElementById('val-xy').textContent = params.rot4dXY.toFixed(2);
|
|
609
|
+
document.getElementById('val-xz').textContent = params.rot4dXZ.toFixed(2);
|
|
610
|
+
document.getElementById('val-yz').textContent = params.rot4dYZ.toFixed(2);
|
|
611
|
+
document.getElementById('val-xw').textContent = params.rot4dXW.toFixed(2);
|
|
612
|
+
document.getElementById('val-yw').textContent = params.rot4dYW.toFixed(2);
|
|
613
|
+
document.getElementById('val-zw').textContent = params.rot4dZW.toFixed(2);
|
|
614
|
+
document.getElementById('val-grid').textContent = params.gridDensity.toFixed(0);
|
|
615
|
+
document.getElementById('val-morph').textContent = params.morphFactor.toFixed(2);
|
|
616
|
+
document.getElementById('val-chaos').textContent = params.chaos.toFixed(2);
|
|
617
|
+
document.getElementById('val-speed').textContent = params.speed.toFixed(2);
|
|
618
|
+
document.getElementById('val-hue').textContent = params.hue.toFixed(0);
|
|
619
|
+
document.getElementById('val-int').textContent = params.intensity.toFixed(2);
|
|
620
|
+
document.getElementById('val-dim').textContent = params.dimension.toFixed(2);
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
// ---- Keyboard shortcuts ----
|
|
624
|
+
document.addEventListener('keydown', (e) => {
|
|
625
|
+
if (e.target.tagName === 'INPUT' || e.target.tagName === 'SELECT') return;
|
|
626
|
+
switch (e.key.toLowerCase()) {
|
|
627
|
+
case '1':
|
|
628
|
+
switchSystem('quantum');
|
|
629
|
+
break;
|
|
630
|
+
case '2':
|
|
631
|
+
switchSystem('faceted');
|
|
632
|
+
break;
|
|
633
|
+
case '3':
|
|
634
|
+
switchSystem('holographic');
|
|
635
|
+
break;
|
|
636
|
+
case 'c':
|
|
637
|
+
togglePanel();
|
|
638
|
+
break;
|
|
639
|
+
case 'r':
|
|
640
|
+
randomizeAll();
|
|
641
|
+
break;
|
|
642
|
+
case ' ':
|
|
643
|
+
e.preventDefault();
|
|
644
|
+
toggleAutoRotate();
|
|
645
|
+
break;
|
|
646
|
+
case 'arrowright':
|
|
647
|
+
params.geometry = (params.geometry + 1) % 24;
|
|
648
|
+
document.getElementById('geo-select').value = params.geometry;
|
|
649
|
+
break;
|
|
650
|
+
case 'arrowleft':
|
|
651
|
+
params.geometry = (params.geometry + 23) % 24;
|
|
652
|
+
document.getElementById('geo-select').value = params.geometry;
|
|
653
|
+
break;
|
|
654
|
+
case 'f':
|
|
655
|
+
if (document.fullscreenElement) {
|
|
656
|
+
document.exitFullscreen();
|
|
657
|
+
} else {
|
|
658
|
+
document.documentElement.requestFullscreen();
|
|
659
|
+
}
|
|
660
|
+
break;
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
|
|
664
|
+
// ---- Mouse interaction ----
|
|
665
|
+
document.addEventListener('mousemove', (e) => {
|
|
666
|
+
const x = e.clientX / window.innerWidth;
|
|
667
|
+
const y = e.clientY / window.innerHeight;
|
|
668
|
+
const intensity = Math.sqrt(x * x + y * y) * 0.5;
|
|
669
|
+
|
|
670
|
+
if (quantum) quantum.updateInteraction(x, y, intensity);
|
|
671
|
+
if (holographic) holographic.updateInteraction(x, y, intensity);
|
|
672
|
+
// Faceted uses parameters directly
|
|
673
|
+
params.mouseIntensity = intensity;
|
|
674
|
+
});
|
|
675
|
+
|
|
676
|
+
document.addEventListener('click', () => {
|
|
677
|
+
params.clickIntensity = 1.0;
|
|
678
|
+
if (holographic) holographic.triggerClick(0.5, 0.5);
|
|
679
|
+
if (quantum) quantum.clickIntensity = 1.0;
|
|
680
|
+
setTimeout(() => {
|
|
681
|
+
params.clickIntensity = 0;
|
|
682
|
+
if (quantum) quantum.clickIntensity = 0;
|
|
683
|
+
}, 300);
|
|
684
|
+
});
|
|
685
|
+
|
|
686
|
+
// ---- Touch interaction ----
|
|
687
|
+
document.addEventListener('touchmove', (e) => {
|
|
688
|
+
if (!e.touches[0]) return;
|
|
689
|
+
const x = e.touches[0].clientX / window.innerWidth;
|
|
690
|
+
const y = e.touches[0].clientY / window.innerHeight;
|
|
691
|
+
const intensity = Math.sqrt(x * x + y * y) * 0.5;
|
|
692
|
+
|
|
693
|
+
if (quantum) quantum.updateInteraction(x, y, intensity);
|
|
694
|
+
if (holographic) holographic.updateInteraction(x, y, intensity);
|
|
695
|
+
params.mouseIntensity = intensity;
|
|
696
|
+
}, { passive: true });
|
|
697
|
+
|
|
698
|
+
// ---- Start ----
|
|
699
|
+
init();
|
|
700
|
+
</script>
|
|
701
|
+
</body>
|
|
702
|
+
</html>
|