-
-
-
-
-
-
-
-
-
+
+
@@ -1152,24 +1129,11 @@ function fs3dBuild() {
S.td.show[key] = el.classList.contains('active');
if (meshes[key]) meshes[key].visible = S.td.show[key];
};
- window.fs3dLight = function(preset) {
- S.td.lightPreset = preset;
- document.querySelectorAll('[data-light]').forEach(btn => {
- btn.classList.toggle('active', btn.dataset.light === preset);
- btn.style.color = btn.dataset.light === preset ? '#3b82f6' : '';
- btn.style.borderColor = btn.dataset.light === preset ? '#3b82f6' : '';
- });
+ window.fs3dLightColor = function(color) {
if (!scene) return;
- const lights = scene.children.filter(c => c.isLight);
- const presets = {
- default: { ambient: 0.4, dir: 0.8 },
- studio: { ambient: 0.3, dir: 1.0 },
- outdoor: { ambient: 0.6, dir: 0.5 },
- };
- const p = presets[preset] || presets.default;
- lights.forEach(l => {
- if (l.isAmbientLight) l.intensity = p.ambient;
- if (l.isDirectionalLight) l.intensity = p.dir;
+ const c = new THREE.Color(color);
+ scene.children.forEach(l => {
+ if (l.isDirectionalLight) l.color.copy(c);
});
};
window.fs3dBg = function(color) {