Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Background rotation #65

Open
VinAr22 opened this issue Jan 29, 2020 · 10 comments
Open

Background rotation #65

VinAr22 opened this issue Jan 29, 2020 · 10 comments
Labels
question Further information is requested

Comments

@VinAr22
Copy link

VinAr22 commented Jan 29, 2020

Hello! Is it possible to replace the HDR scene with a black background, but keep hdr`s reflectivity on the object?

@jaxry
Copy link
Contributor

jaxry commented Jan 29, 2020

Yes it is! We just recently added support for this. Just set your scene.background to a THREE.Color, and your background should use that color. I've updated the docs with this new information.

@VinAr22
Copy link
Author

VinAr22 commented Jan 30, 2020

Fantastic! Can i use texture as background in the same way?

@jaxry
Copy link
Contributor

jaxry commented Feb 27, 2020

Sorry for the late response. I hadn't seen your reply until now :(

A 2D texture overlaid on the background doesn't work at the moment, but if you give scene.background a EnvironmentLight, the renderer will use that as the background (independent of lighting for the scene). Since Three.js officially supports textures as backgrounds, it's on my list to get it working for the ray tracing renderer too.

@VinAr22
Copy link
Author

VinAr22 commented Feb 27, 2020

All is ok, dont worry about that. Thanks for the information!

@VinAr22
Copy link
Author

VinAr22 commented Mar 5, 2020

@jaxry hi! Can you explain to me is it possible to rotate the environment around the 'y' axis?

@jaxry
Copy link
Contributor

jaxry commented Mar 5, 2020

Hi @VinAr22 . Rotating an environment light directly is not supported right now, similar to how you can't rotate cubemaps in Three.js either. But you can effectively rotate the light by rotating the entire scene instead.

e.g. scene.rotateY(0.5)

Would that work for you?

@VinAr22
Copy link
Author

VinAr22 commented Mar 5, 2020

Thanks for the quick reply @jaxry! Im tried this solution. This does not correctly work if i pan my camera using orbit controls

@jaxry
Copy link
Contributor

jaxry commented Mar 5, 2020

I think I ran into this issue too. Are you adding the camera to the scene object? If so, does removing the camera from the scene work?

@VinAr22
Copy link
Author

VinAr22 commented Mar 5, 2020

Yes, it does

@VinAr22
Copy link
Author

VinAr22 commented Mar 5, 2020

@jaxry I also tried to add object3d to the scene and attach an orbit pivot to it, but that didn't work either

@jaxry jaxry changed the title Overriding scene background Background rotation Apr 20, 2020
@elfrank elfrank added the question Further information is requested label May 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants