You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I try to use useEffect without passing the globe as reference I also get the same result:
useEffect(()=>{
// const globeEl = useRef()
debugger
var ArtificialLight = new THREE.DirectionalLight(0xffffff, 0.6)
ArtificialLight.position.set( -2, -1, 1 );
oGlobeEl.current.scene().add(ArtificialLight )
//JSON.stringify(oGlobeEl.current.scene().children.find(obj3d => obj3d.type == 'DirectionalLight'))
},[oGlobeEl])
I've noticed you mention a lights method in the Render control but I found no example of its usage, not I have managed to access said method.
Moreover, the other issue opened regarding this doesn't show a clear way of addressing this issue (#17), since it only mentions the code bit being used outside of useEffect, but doesn't specify where.
The text was updated successfully, but these errors were encountered:
i'm trying to modify the default DirectionalLight using useEffect, but the scene it loads doesn't yet have the DirectionalLight as its child:
oGlobeEl.current.scene().children
[Mesh]
Mesh {isObject3D: true, uuid: '86eda375-6611-413d-8df9-a2ef4f367ff5', name: '', type: 'Mesh', parent: Scene, …}
If I try to use useEffect without passing the globe as reference I also get the same result:
useEffect(()=>{
// const globeEl = useRef()
debugger
var ArtificialLight = new THREE.DirectionalLight(0xffffff, 0.6)
ArtificialLight.position.set( -2, -1, 1 );
oGlobeEl.current.scene().add(ArtificialLight )
//JSON.stringify(oGlobeEl.current.scene().children.find(obj3d => obj3d.type == 'DirectionalLight'))
},[oGlobeEl])
oGlobeEl.current.scene().children
[Mesh]
Mesh {isObject3D: true, uuid: '86eda375-6611-413d-8df9-a2ef4f367ff5', name: '', type: 'Mesh', parent: Scene, …}
I've noticed you mention a lights method in the Render control but I found no example of its usage, not I have managed to access said method.
Moreover, the other issue opened regarding this doesn't show a clear way of addressing this issue (#17), since it only mentions the code bit being used outside of useEffect, but doesn't specify where.
The text was updated successfully, but these errors were encountered: