Change lights orientation ?
risqueescer opened this issue · comments
Hi,
I'm looking to build 3D terrain model viewer. When the .obj is shown, the model is very dark. I think the issue comes from the fact the model is in geodetics coordinate (and in consequence the scene is not in the normal orientation). I've change the orientation of the camera to be able to turn around the object. Also the grid is perpendicular to the terrain modeled (not an issue for me i hide it).
Is there a way to change easily the lights angle ? it's the only thing that annoy me for my needs.
I precise that i can’t change the coordinate system of my object, so i need to change the viewer system characteristics instead.
Thank you for your advise and thanks for this work !
Regards
Jonathan
Hello,
Sorry for the late reply. The lighting is not properly done. But I don't know the parameters I should use. So any suggestion about it would help.
The code for the lights is here: https://github.com/cgwire/js-3d-model-viewer/blob/master/src/index.js#L47-L75
Additionally, you can modify the scene when you retrieve it. This library relies on Three.js.
const scene = modelPlayer.prepareScene(viewerElement, opts)
Another option is to apply a transformation matrix to your model to give it the right orientation.