@@ -5,58 +5,46 @@ import {
55 EffectComposer ,
66 ToneMapping ,
77} from "@react-three/postprocessing" ;
8- import { useEffect , useState } from "react" ;
98import { useUnitSize } from "../hooks/useWindowSize" ;
109import AboutScene from "./about/about" ;
1110
1211function Scene ( ) {
1312 // const { width, height } = useWindowSize();
1413 const unit = useUnitSize ( ) ;
15- const [ show , setShow ] = useState ( false ) ;
16- useEffect ( ( ) => {
17- setTimeout ( ( ) => {
18- setShow ( true ) ;
19- } , 2000 ) ;
20- } , [ ] ) ;
2114 return (
2215 < div className = "flex h-full w-full items-center justify-center p-4" >
23- { show && (
24- < Canvas
25- orthographic
26- shadows
27- camera = { {
28- position : [ 10 , 10 , 10 ] ,
29- near : - 2000 ,
30- } }
31- >
32- { /* Scene effects */ }
33- < OrbitControls
34- // enablePan={false}
35- // enableZoom={false}
36- maxPolarAngle = { Math . PI / 2 }
37- maxAzimuthAngle = { Math . PI / 2 }
38- minAzimuthAngle = { 0 }
39- />
40- < EffectComposer >
41- < Bloom mipmapBlur luminanceThreshold = { 1 } levels = { 1 } intensity = { 1 } />
42- < ToneMapping />
43- </ EffectComposer >
16+ < Canvas
17+ orthographic
18+ shadows
19+ camera = { {
20+ position : [ 10 , 10 , 10 ] ,
21+ near : - 2000 ,
22+ } }
23+ >
24+ { /* Scene effects */ }
25+ < OrbitControls
26+ // enablePan={false}
27+ // enableZoom={false}
28+ maxPolarAngle = { Math . PI / 2 }
29+ maxAzimuthAngle = { Math . PI / 2 }
30+ minAzimuthAngle = { 0 }
31+ />
32+ < EffectComposer >
33+ < Bloom mipmapBlur luminanceThreshold = { 1 } levels = { 1 } intensity = { 1 } />
34+ < ToneMapping />
35+ </ EffectComposer >
4436
45- { /* Lighting */ }
46- < ambientLight intensity = { 0.6 } />
47- < directionalLight position = { [ 100 , 100 , 0 ] } intensity = { 3 } castShadow />
48- < directionalLight position = { [ 0 , 100 , 50 ] } intensity = { 2 } />
37+ { /* Lighting */ }
38+ < ambientLight intensity = { 0.6 } />
39+ < directionalLight position = { [ 100 , 100 , 0 ] } intensity = { 3 } castShadow />
40+ < directionalLight position = { [ 0 , 100 , 50 ] } intensity = { 2 } />
4941
50- { /* Scene switcher */ }
51- < directionalLight
52- position = { [ - 100 , - 100 , 0 ] }
53- intensity = { Math . PI / 2 }
54- />
55- < mesh scale = { [ unit , unit , unit ] } receiveShadow >
56- < AboutScene />
57- </ mesh >
58- </ Canvas >
59- ) }
42+ { /* Scene switcher */ }
43+ < directionalLight position = { [ - 100 , - 100 , 0 ] } intensity = { Math . PI / 2 } />
44+ < mesh scale = { [ unit , unit , unit ] } receiveShadow >
45+ < AboutScene />
46+ </ mesh >
47+ </ Canvas >
6048 </ div >
6149 ) ;
6250}
0 commit comments