Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change lights orientation ? #22

Open
risqueescer opened this issue Aug 8, 2023 · 2 comments
Open

Change lights orientation ? #22

risqueescer opened this issue Aug 8, 2023 · 2 comments

Comments

@risqueescer
Copy link

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

@risqueescer risqueescer changed the title Change lightning ? Change lights ? Aug 8, 2023
@risqueescer risqueescer changed the title Change lights ? Change lights orientation ? Aug 8, 2023
@frankrousseau
Copy link
Contributor

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)

@frankrousseau
Copy link
Contributor

Another option is to apply a transformation matrix to your model to give it the right orientation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants