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

directional light pointing doesn't seem to be working #7965

Closed
JamesLawrenceGSI opened this Issue Jan 14, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@JamesLawrenceGSI

JamesLawrenceGSI commented Jan 14, 2016

I've posted on SO but for the last 2 weeks haven't had a response so I'm trying here instead.

I can't seem to get directional lights to point at anything other than 0,0,0 in r73:

var directionalLight = new THREE.DirectionalLight( 0xffffff );
directionalLight.position.set( 10, 10, 10 );
directionalLight.target.position.set(100, 100, 100);
directionalLight.intensity = 0.5;
directionalLight.castShadow = true;
directionalLight.shadowCameraLeft = -30;
directionalLight.shadowCameraRight = 30;
directionalLight.shadowCameraTop = 30;
directionalLight.shadowCameraBottom = -30;
directionalLight.shadowCameraNear = 0;
directionalLight.shadowCameraFar = 100;
scene.add(directionalLight);

var helper = new THREE.DirectionalLightHelper( directionalLight );
scene.add(helper);

The helper shows the light is still pointing at 0,0,0, despite the call to target.position.set().

To create a shadow rendering range system, I wanted the directional light to follow the user camera, I can't do this and keep the angle constant if the target function isn't working. Any ideas?

@WestLangley

This comment has been minimized.

Show comment
Hide comment
@WestLangley

WestLangley Jan 14, 2016

Collaborator

See if you can improve your SO question if you are not getting a response.

Collaborator

WestLangley commented Jan 14, 2016

See if you can improve your SO question if you are not getting a response.

@JamesLawrenceGSI

This comment has been minimized.

Show comment
Hide comment
@JamesLawrenceGSI

JamesLawrenceGSI Jan 14, 2016

Thanks for the short and insulting response. However I put it here not because I wasn't getting a response on SO per say, but because I assume the problem could be an actual issue with r73. Thanks for further disillusioning me with three.js. Additionally, how do you know my question wasn't good enough? The comment above was not the question on SO. I'm dissapointed.

JamesLawrenceGSI commented Jan 14, 2016

Thanks for the short and insulting response. However I put it here not because I wasn't getting a response on SO per say, but because I assume the problem could be an actual issue with r73. Thanks for further disillusioning me with three.js. Additionally, how do you know my question wasn't good enough? The comment above was not the question on SO. I'm dissapointed.

@WestLangley

This comment has been minimized.

Show comment
Hide comment
@WestLangley

WestLangley Jan 14, 2016

Collaborator

@JamesLawrenceGSI Sorry. I did not mean to be insulting. I could have worded that better. I did go to SO to try to find your original post so I could help you. If you post on SO, I'll be glad to help you there.

Collaborator

WestLangley commented Jan 14, 2016

@JamesLawrenceGSI Sorry. I did not mean to be insulting. I could have worded that better. I did go to SO to try to find your original post so I could help you. If you post on SO, I'll be glad to help you there.

@WestLangley

This comment has been minimized.

Show comment
Hide comment
@WestLangley

WestLangley Jan 14, 2016

Collaborator

@JamesLawrenceGSI Also, #5555 (comment) may be related to your issue.

Collaborator

WestLangley commented Jan 14, 2016

@JamesLawrenceGSI Also, #5555 (comment) may be related to your issue.

@JamesLawrenceGSI

This comment has been minimized.

Show comment
Hide comment
@JamesLawrenceGSI

JamesLawrenceGSI Jan 14, 2016

@WestLangley - Ok no problem, water under the bridge! :) Though just in case you do have an insight into this, my SO post is here: http://stackoverflow.com/questions/34571289/shadow-range-for-directional-lights-in-three-js.

JamesLawrenceGSI commented Jan 14, 2016

@WestLangley - Ok no problem, water under the bridge! :) Though just in case you do have an insight into this, my SO post is here: http://stackoverflow.com/questions/34571289/shadow-range-for-directional-lights-in-three-js.

@WestLangley

This comment has been minimized.

Show comment
Hide comment
@WestLangley

WestLangley Jan 14, 2016

Collaborator

Answered on SO.

Collaborator

WestLangley commented Jan 14, 2016

Answered on SO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment