Open mdwint opened 7 years ago
Ah yes, this is because Three does directional light rotation in a strange way...
See https://github.com/toxicFork/react-three-renderer/issues/65#issuecomment-219002299
I think this should make it work the same as vanilla threejs:
// anywhere in the file, e.g. before the class
const origin = new THREE.Vector3(0, 0, 0);
// in the render
<directionalLight
// other props
lookAt={origin}
/>
I will need to add a note to directional light properties to explain this.
I guess it's "kind of a bug" that it behaves different than Three, but I'll still find a way to fix it without having inconsisterncies in behaviour with other components... (e.g. require one of the rotation properties?)
Nice, that fixed it. Thanks a lot!
Happy to hear :)
I've taken the three.js OBJLoader example and converted it to a React component.
As you can see in the screenshots below, something is off with the lighting. Even after increasing the intensity to 5, the directional light looks very dark, as if only the object's edges are illuminated.
Any idea what I might be doing wrong? Does your library set any defaults that I'm not taking into account? (I have no prior experience with three.js)
Original (source):
My result (source below):