cube-parameters
Version:
A sophisticated 3D model viewer built with React, TypeScript, and Three.js, featuring advanced visualization tools, measurement capabilities, and lighting controls.
30 lines (25 loc) • 592 B
text/typescript
import { useState } from 'react';
interface EnvironmentSettings {
showGrid: boolean;
groundColor: string;
skyColor: string;
showGround: boolean;
preset?: string;
background?: 'gradient' | 'solid' | 'transparent';
cameraFov?: number;
}
export const useEnvironmentState = () => {
const [environment, setEnvironment] = useState<EnvironmentSettings>({
showGrid: true,
groundColor: '#4a5568',
skyColor: '#1a202c',
showGround: true,
preset: 'studio',
background: 'gradient',
cameraFov: 75
});
return {
environment,
setEnvironment
};
};