Add project configuration and scene controller

- Created a new project configuration file `project.json` with metadata, camera settings, scene details, and lighting configurations.
- Implemented a new scene controller in `scena-controller copy.js` to manage 3D scene rendering, model loading, and user interactions.
- Integrated various loaders for STL and GLB models, along with functionality for dynamic material updates and model visibility toggling.
- Enhanced camera controls using TrackballControls for improved user navigation within the 3D environment.
This commit is contained in:
2026-01-21 16:10:18 +01:00
parent 7dca231004
commit 234cd7d415
28 changed files with 1699 additions and 208 deletions

View File

@@ -7,71 +7,91 @@
"label_en": "Lateral bands",
"fields": [
{
"field_type": "select",
"data_type": "model",
"material": "metal",
"color": "#FFFFFF",
"field_type": "group",
"label": "DX",
"label_en": "",
"options": [
{
"label": "Nessuno",
"label_en": "None",
"value": ""
},
"label_en": "Right",
"id": 100,
"parent_id": 99,
"fields": [
{
"field_type": "checkbox",
"data_type": "model",
"label_en": "Band 14",
"label": "Banda 14",
"value": "2_banda 14"
"value": "2_banda 14",
"material": "metal",
"color": "#FFFFFF",
"parent_id": 100,
"id": "input-101"
},
{
"field_type": "checkbox",
"data_type": "model",
"label_en": "Band 15",
"label": "Banda 15",
"value": "2_banda 15"
},
"value": "2_banda 15",
"material": "metal",
"color": "#FFFFFF",
"parent_id": 100,
"id": "input-102"
},
{
"field_type": "checkbox",
"data_type": "model",
"label_en": "Band 16",
"label": "Banda 16",
"value": "2_banda 16"
}
],
"parent_id": 1,
"id": "input-1"
"value": "2_banda 16",
"material": "metal",
"color": "#FFFFFF",
"parent_id": 100,
"id": "input-103"
}
]
},
{
"field_type": "select",
"data_type": "model",
"material": "metal",
"color": "#FFFFFF",
{
"field_type": "group",
"label": "SX",
"label_en": "",
"options": [
{
"label": "Nessuno",
"label_en": "None",
"value": ""
},
"label_en": "Left",
"id": 101,
"parent_id": 99,
"fields": [
{
"field_type": "checkbox",
"data_type": "model",
"label_en": "Band 24",
"label": "Banda 24",
"value": "2_banda 24"
"value": "2_banda 24",
"material": "metal",
"color": "#FFFFFF",
"parent_id": 101,
"id": "input-104"
},
{
"field_type": "checkbox",
"data_type": "model",
"label_en": "Band 25",
"label": "Banda 25",
"value": "2_banda 25"
},
"value": "2_banda 25",
"material": "metal",
"color": "#FFFFFF",
"parent_id": 101,
"id": "input-105"
},
{
"field_type": "checkbox",
"data_type": "model",
"label_en": "Band 26",
"label": "Banda 26",
"value": "2_banda 26"
}
],
"parent_id": 1,
"id": "input-2"
}
"value": "2_banda 26",
"material": "metal",
"color": "#FFFFFF",
"parent_id": 101,
"id": "input-106"
}
]
}
],
"id": 1
"id": 99
},
{
"label": "TADS",
@@ -114,8 +134,8 @@
"data_type": "model",
"material": "metal",
"color": "#FFFFFF",
"label": "Numero di Tads",
"label_en": "Number of Tads",
"label": "Tipologia Viti",
"label_en": "Type of Screws",
"options": [
{
"label": "Nessuno",
@@ -223,6 +243,7 @@
"label_en": "TADS Tandem",
"material": "metal",
"color": "#FFFFFF",
"reset_field": "input-4",
"options": [
{
"label": "Nessuno",
@@ -306,6 +327,8 @@
"data_type": "model",
"label": "Modulo DX",
"label_en": "Right Module",
"depends_on": {"id":"input-14", "value":"11_modulo dx", "hide": true},
"material": "metal",
"value": "10_modulo dx",
"color": "#FFFFFF",
@@ -316,6 +339,7 @@
"data_type": "model",
"label": "Modulo SX",
"label_en": "Left Module",
"depends_on": {"id":"input-15", "value":"11_modulo sx", "hide": true},
"material": "metal",
"value": "10_modulo sx",
"color": "#FFFFFF",
@@ -333,6 +357,8 @@
"data_type": "model",
"label": "Modulo DX",
"label_en": "Right Module",
"depends_on": {"id":"input-12", "value":"10_modulo dx", "hide": true},
"material": "metal",
"value": "11_modulo dx",
"color": "#FFFFFF",
@@ -343,6 +369,7 @@
"data_type": "model",
"label": "Modulo SX",
"label_en": "Left Module",
"depends_on": {"id":"input-13", "value":"10_modulo sx", "hide": true},
"material": "metal",
"value": "11_modulo sx",
"color": "#FFFFFF",
@@ -360,8 +387,14 @@
"data_type": "model",
"label": "Modulo DX",
"label_en": "Right Module",
"depends_on": {"id":"input-18", "value":"13_modulo x intrudere dx", "hide": true},
"material": "metal",
"value": "12_modulo dx",
"other_models": [{
"color": "#f073c4",
"material": "plastic",
"model": "12_molla dx"
}],
"color": "#FFFFFF",
"parent_id": 11,
"id": "input-16"
@@ -370,8 +403,14 @@
"data_type": "model",
"label": "Modulo SX",
"label_en": "Left Module",
"material": "metal",
"depends_on": {"id":"input-19", "value":"13_modulo x intrudere sx", "hide": true},
"value": "12_modulo sx",
"other_models": [{
"color": "#f073c4",
"material": "plastic",
"model": "12_molla sx"
}],
"material": "metal",
"color": "#FFFFFF",
"parent_id": 11,
"id": "input-17"
@@ -387,6 +426,16 @@
"data_type": "model",
"label": "Modulo DX",
"label_en": "Right Module",
"depends_on": {"id":"input-16", "value":"12_modulo dx", "hide": true},
"other_models": [{
"color": "#f073c4",
"material": "plastic",
"model": "13_molla dx"
},{
"color": "#34eb3d",
"material": "plastic",
"model": "13_denti dx"
}],
"material": "metal",
"value": "13_modulo x intrudere dx",
"color": "#FFFFFF",
@@ -397,6 +446,16 @@
"data_type": "model",
"label": "Modulo SX",
"label_en": "Left Module",
"depends_on": {"id":"input-17", "value":"12_modulo sx", "hide": true},
"other_models": [{
"color": "#f073c4",
"material": "plastic",
"model": "13_molla sx"
},{
"color": "#34eb3d",
"material": "plastic",
"model": "13_denti sx"
}],
"material": "metal",
"value": "13_modulo x intrudere sx",
"color": "#FFFFFF",
@@ -412,8 +471,9 @@
{
"field_type": "checkbox",
"data_type": "model",
"label": "Attacchi per Mask",
"label_en": "Mask Hooks",
"label": "Attacchi per Aligners",
"label_en": "Aligners Hooks",
"hide_elements": ["input-21","input-22", "input-25"],
"material": "metal",
"value": "14_attacchi x mask",
"color": "#FFFFFF",
@@ -424,6 +484,7 @@
"data_type": "model",
"label": "Attacco doppia canula DX",
"label_en": "Double Cannula Hook Right",
"hide_elements": ["input-20"],
"material": "metal",
"value": "14_attacco doppia canula dx",
"color": "#FFFFFF",
@@ -434,6 +495,7 @@
"data_type": "model",
"label": "Attacco doppia canula SX",
"label_en": "Double Cannula Hook Left",
"hide_elements": ["input-20"],
"material": "metal",
"value": "14_attacco doppia canula sx",
"color": "#FFFFFF",
@@ -464,6 +526,7 @@
"data_type": "model",
"label": "Gradino",
"label_en": "Step",
"hide_elements": ["input-20"],
"material": "metal",
"value": "14_gradino",
"color": "#FFFFFF",

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

467
src/assets/project.json Normal file
View File

@@ -0,0 +1,467 @@
{
"metadata": {},
"project": {
"shadows": true,
"shadowType": 1,
"toneMapping": 0,
"toneMappingExposure": 1
},
"camera": {
"metadata": {
"version": 4.7,
"type": "Object",
"generator": "Object3D.toJSON"
},
"object": {
"uuid": "395a500c-0494-41ec-b6d0-c8bbe4349725",
"type": "PerspectiveCamera",
"name": "Camera",
"layers": 1,
"matrix": [
0.11049213351682519,
2.7755575615628914e-17,
0.9938769986426388,
0,
0.4629545750185746,
0.8848864948632306,
-0.051467977209491755,
0,
-0.8794683336540725,
0.4658067101370114,
0.09777299673766349,
0,
-205.25558887415772,
82.23047074745682,
17.26020551692521,
1
],
"up": [
0,
1,
0
],
"fov": 50,
"zoom": 1,
"near": 0.01,
"far": 1000,
"focus": 10,
"aspect": 1.7745302713987474,
"filmGauge": 35,
"filmOffset": 0
}
},
"controls": {
"center": [
-50,
0,
0
]
},
"scene": {
"metadata": {
"version": 4.7,
"type": "Object",
"generator": "Object3D.toJSON"
},
"object": {
"uuid": "a2253e4f-b675-48b1-8c2c-76d897bcac25",
"type": "Scene",
"name": "Scene",
"layers": 1,
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
],
"up": [
0,
1,
0
],
"children": [
{
"uuid": "2ef7dca1-f570-417b-b55a-46c017f98630",
"type": "Scene",
"name": "Scene",
"layers": 1,
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
],
"up": [
0,
1,
0
],
"children": [
{
"uuid": "f106381a-534c-497e-acbd-a3b2ad121b9a",
"type": "DirectionalLight",
"name": "DirectionalLight",
"layers": 1,
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
3.0997198829600077,
-97.44223652603492,
1
],
"up": [
0,
1,
0
],
"color": 16777215,
"intensity": 0.8,
"shadow": {
"camera": {
"uuid": "38eaf299-1e78-4fc7-adce-080811a9fe47",
"type": "OrthographicCamera",
"layers": 1,
"up": [
0,
1,
0
],
"zoom": 1,
"left": -5,
"right": 5,
"top": 5,
"bottom": -5,
"near": 0.5,
"far": 500
}
},
"target": "0e530621-c1bb-48c8-87e3-224a85a2e9c1"
},
{
"uuid": "0b4faf09-07b3-4ab2-80a7-955bf83b8815",
"type": "DirectionalLight",
"name": "DirectionalLight",
"layers": 1,
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
50,
0,
0,
1
],
"up": [
0,
1,
0
],
"color": 16777215,
"intensity": 1,
"shadow": {
"camera": {
"uuid": "3487b036-5d5a-4331-b589-3b9c0472d0af",
"type": "OrthographicCamera",
"layers": 1,
"up": [
0,
1,
0
],
"zoom": 1,
"left": -5,
"right": 5,
"top": 5,
"bottom": -5,
"near": 0.5,
"far": 500
}
},
"target": "77316e30-bf2c-49ae-bbbd-1a40c413140c"
},
{
"uuid": "4ef0f77a-df7b-42f8-809d-35028cfc71bc",
"type": "DirectionalLight",
"name": "DirectionalLight",
"layers": 1,
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
-50,
0,
0,
1
],
"up": [
0,
1,
0
],
"color": 16777215,
"intensity": 1,
"shadow": {
"camera": {
"uuid": "0d0ac848-ef38-4ddc-9d4b-bd1a3fa259e6",
"type": "OrthographicCamera",
"layers": 1,
"up": [
0,
1,
0
],
"zoom": 1,
"left": -5,
"right": 5,
"top": 5,
"bottom": -5,
"near": 0.5,
"far": 500
}
},
"target": "9a8f9881-3997-4b11-9a5d-ab5dbaf0de11"
},
{
"uuid": "54bbb245-78cb-4ab9-bd57-0f02711f8a03",
"type": "DirectionalLight",
"name": "DirectionalLight",
"layers": 1,
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
-38.28056498637591,
4.399184106340684,
1
],
"up": [
0,
1,
0
],
"color": 16777215,
"intensity": 0.6,
"shadow": {
"camera": {
"uuid": "ba78f102-e863-4df9-a295-f56af374dbe9",
"type": "OrthographicCamera",
"layers": 1,
"up": [
0,
1,
0
],
"zoom": 1,
"left": -5,
"right": 5,
"top": 5,
"bottom": -5,
"near": 0.5,
"far": 500
}
},
"target": "ac43e49a-3301-4a12-9d90-0ce724dff367"
},
{
"uuid": "5f633583-57db-4472-be10-2dce0a75d139",
"type": "DirectionalLight",
"name": "DirectionalLight",
"layers": 1,
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
15.833769711930671,
37.90623637377939,
1
],
"up": [
0,
1,
0
],
"color": 16777215,
"intensity": 0.5,
"shadow": {
"camera": {
"uuid": "9e8a1c42-2f57-4648-9db1-40e59ac6b6e0",
"type": "OrthographicCamera",
"layers": 1,
"up": [
0,
1,
0
],
"zoom": 1,
"left": -5,
"right": 5,
"top": 5,
"bottom": -5,
"near": 0.5,
"far": 500
}
},
"target": "44ee6450-dc88-46e5-90e7-781de0a69288"
}
],
"backgroundRotation": [
0,
0,
0,
"XYZ"
],
"environmentRotation": [
0,
0,
0,
"XYZ"
]
},
{
"uuid": "09cd262e-79bd-4975-b449-1b813209f26d",
"type": "DirectionalLight",
"name": "DirectionalLight",
"layers": 1,
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
25.33505179809299,
-6.19180174206452,
1
],
"up": [
0,
1,
0
],
"color": 16777215,
"intensity": 0.6,
"shadow": {
"camera": {
"uuid": "192b16bb-49e2-4be6-8a88-5058304606a6",
"type": "OrthographicCamera",
"layers": 1,
"up": [
0,
1,
0
],
"zoom": 1,
"left": -5,
"right": 5,
"top": 5,
"bottom": -5,
"near": 0.5,
"far": 500
}
},
"target": "06277cc9-87d0-49d9-8716-5f745df7ee03"
}
],
"backgroundBlurriness": 0.2,
"backgroundIntensity": 0.93,
"backgroundRotation": [
0,
0,
0,
"XYZ"
],
"environmentRotation": [
0,
0,
0,
"XYZ"
]
}
},
"scripts": {},
"history": {
"undos": [],
"redos": []
},
"environment": null
}

View File

@@ -11,131 +11,262 @@
"layers": 1,
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],
"up": [0,1,0],
"children": [
{
"uuid": "f106381a-534c-497e-acbd-a3b2ad121b9a",
"type": "DirectionalLight",
"name": "DirectionalLight",
"layers": 1,
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,3.0997198829600077,-97.44223652603492,1],
"up": [0,1,0],
"color": 16777215,
"intensity": 0.8,
"shadow": {
"camera": {
"uuid": "38eaf299-1e78-4fc7-adce-080811a9fe47",
"type": "OrthographicCamera",
"layers": 1,
"up": [0,1,0],
"zoom": 1,
"left": -5,
"right": 5,
"top": 5,
"bottom": -5,
"near": 0.5,
"far": 500
}
}
},
{
"uuid": "0b4faf09-07b3-4ab2-80a7-955bf83b8815",
"type": "DirectionalLight",
"name": "DirectionalLight",
"layers": 1,
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,50,0,0,1],
"up": [0,1,0],
"color": 16777215,
"intensity": 1,
"shadow": {
"camera": {
"uuid": "3487b036-5d5a-4331-b589-3b9c0472d0af",
"type": "OrthographicCamera",
"layers": 1,
"up": [0,1,0],
"zoom": 1,
"left": -5,
"right": 5,
"top": 5,
"bottom": -5,
"near": 0.5,
"far": 500
}
}
},
{
"uuid": "4ef0f77a-df7b-42f8-809d-35028cfc71bc",
"type": "DirectionalLight",
"name": "DirectionalLight",
"layers": 1,
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,-50,0,0,1],
"up": [0,1,0],
"color": 16777215,
"intensity": 1,
"shadow": {
"camera": {
"uuid": "0d0ac848-ef38-4ddc-9d4b-bd1a3fa259e6",
"type": "OrthographicCamera",
"layers": 1,
"up": [0,1,0],
"zoom": 1,
"left": -5,
"right": 5,
"top": 5,
"bottom": -5,
"near": 0.5,
"far": 500
}
}
},
{
"uuid": "54bbb245-78cb-4ab9-bd57-0f02711f8a03",
"type": "DirectionalLight",
"name": "DirectionalLight",
"layers": 1,
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,-38.28056498637591,4.399184106340684,1],
"up": [0,1,0],
"color": 16777215,
"intensity": 0.6,
"shadow": {
"camera": {
"uuid": "ba78f102-e863-4df9-a295-f56af374dbe9",
"type": "OrthographicCamera",
"layers": 1,
"up": [0,1,0],
"zoom": 1,
"left": -5,
"right": 5,
"top": 5,
"bottom": -5,
"near": 0.5,
"far": 500
}
}
},
{
"uuid": "5f633583-57db-4472-be10-2dce0a75d139",
"type": "DirectionalLight",
"name": "DirectionalLight",
"layers": 1,
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,15.833769711930671,37.90623637377939,1],
"up": [0,1,0],
"color": 16777215,
"intensity": 0.5,
"shadow": {
"camera": {
"uuid": "9e8a1c42-2f57-4648-9db1-40e59ac6b6e0",
"type": "OrthographicCamera",
"layers": 1,
"up": [0,1,0],
"zoom": 1,
"left": -5,
"right": 5,
"top": 5,
"bottom": -5,
"near": 0.5,
"far": 500
}
}
}]
"children": [
{
"uuid": "f106381a-534c-497e-acbd-a3b2ad121b9a",
"type": "DirectionalLight",
"name": "DirectionalLight",
"layers": 1,
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
3.0997198829600077,
-97.44223652603492,
1
],
"up": [
0,
1,
0
],
"color": 16777215,
"intensity": 0.8,
"shadow": {
"camera": {
"uuid": "38eaf299-1e78-4fc7-adce-080811a9fe47",
"type": "OrthographicCamera",
"layers": 1,
"up": [
0,
1,
0
],
"zoom": 1,
"left": -5,
"right": 5,
"top": 5,
"bottom": -5,
"near": 0.5,
"far": 500
}
},
"target": "0e530621-c1bb-48c8-87e3-224a85a2e9c1"
},
{
"uuid": "0b4faf09-07b3-4ab2-80a7-955bf83b8815",
"type": "DirectionalLight",
"name": "DirectionalLight",
"layers": 1,
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
50,
0,
0,
1
],
"up": [
0,
1,
0
],
"color": 16777215,
"intensity": 1,
"shadow": {
"camera": {
"uuid": "3487b036-5d5a-4331-b589-3b9c0472d0af",
"type": "OrthographicCamera",
"layers": 1,
"up": [
0,
1,
0
],
"zoom": 1,
"left": -5,
"right": 5,
"top": 5,
"bottom": -5,
"near": 0.5,
"far": 500
}
},
"target": "77316e30-bf2c-49ae-bbbd-1a40c413140c"
},
{
"uuid": "4ef0f77a-df7b-42f8-809d-35028cfc71bc",
"type": "DirectionalLight",
"name": "DirectionalLight",
"layers": 1,
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
-50,
0,
0,
1
],
"up": [
0,
1,
0
],
"color": 16777215,
"intensity": 1,
"shadow": {
"camera": {
"uuid": "0d0ac848-ef38-4ddc-9d4b-bd1a3fa259e6",
"type": "OrthographicCamera",
"layers": 1,
"up": [
0,
1,
0
],
"zoom": 1,
"left": -5,
"right": 5,
"top": 5,
"bottom": -5,
"near": 0.5,
"far": 500
}
},
"target": "9a8f9881-3997-4b11-9a5d-ab5dbaf0de11"
},
{
"uuid": "54bbb245-78cb-4ab9-bd57-0f02711f8a03",
"type": "DirectionalLight",
"name": "DirectionalLight",
"layers": 1,
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
-38.28056498637591,
4.399184106340684,
1
],
"up": [
0,
1,
0
],
"color": 16777215,
"intensity": 0.6,
"shadow": {
"camera": {
"uuid": "ba78f102-e863-4df9-a295-f56af374dbe9",
"type": "OrthographicCamera",
"layers": 1,
"up": [
0,
1,
0
],
"zoom": 1,
"left": -5,
"right": 5,
"top": 5,
"bottom": -5,
"near": 0.5,
"far": 500
}
},
"target": "ac43e49a-3301-4a12-9d90-0ce724dff367"
},
{
"uuid": "5f633583-57db-4472-be10-2dce0a75d139",
"type": "DirectionalLight",
"name": "DirectionalLight",
"layers": 1,
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
15.833769711930671,
37.90623637377939,
1
],
"up": [
0,
1,
0
],
"color": 16777215,
"intensity": 0.5,
"shadow": {
"camera": {
"uuid": "9e8a1c42-2f57-4648-9db1-40e59ac6b6e0",
"type": "OrthographicCamera",
"layers": 1,
"up": [
0,
1,
0
],
"zoom": 1,
"left": -5,
"right": 5,
"top": 5,
"bottom": -5,
"near": 0.5,
"far": 500
}
},
"target": "44ee6450-dc88-46e5-90e7-781de0a69288"
}
]
}
}