This commit is contained in:
sebseb7
2025-08-25 06:56:20 +02:00
parent c208e5f760
commit 2ae4fee01a
2 changed files with 10 additions and 4 deletions

View File

@@ -12,16 +12,18 @@ let cameraConfig = null;
// Load camera configuration from config file
async function loadCameraConfig() {
try {
const response = await fetch('camera-config.json');
const response = await fetch('./camera-config.json');
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
cameraConfig = await response.json();
console.log('Camera config loaded:', cameraConfig);
console.log('Camera config loaded successfully:', cameraConfig);
return cameraConfig;
} catch (error) {
console.warn('Could not load camera config, using defaults:', error);
// Return default config if file load fails
console.warn('⚠️ Could not load camera-config.json, using original defaults.');
console.log('📝 To use custom camera settings, ensure camera-config.json is accessible from your web server.');
// Return original simple defaults
return {
camera: {
position: { x: 20, y: 20, z: 20 },

View File

@@ -57,6 +57,10 @@ module.exports = (env, argv) => {
{
from: 'cube/',
to: 'cube/'
},
{
from: 'camera-config.json',
to: 'camera-config.json'
}
]
})