Created
August 18, 2021 03:54
-
-
Save kenjiSpecial/3c3d58b8000739a77126d2696d60e49f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { ILights } from 'src/types/lights'; | |
import { GLTF } from 'three-stdlib'; | |
import { GltfModel } from './gltf-model'; | |
export const GltfScene = (props: { gltf: GLTF | undefined; lights: ILights }) => { | |
const { gltf, lights } = props; | |
const gltfElement = gltf ? <GltfModel gltf={gltf} lightOption={lights.additonalLights} /> : <group />; | |
const baseLightElement = lights.baseLight ? ( | |
<ambientLight intensity={lights.baseLight.intensity} visible={lights.baseLight.visible} /> | |
) : ( | |
<group /> | |
); | |
return ( | |
<group> | |
{baseLightElement} | |
{gltfElement} | |
</group> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment