getCubeTexture(){
let path = "cubemap/";
let format = '.png';
let urls = [
path + 'px' + format, path + 'nx' + format,
path + 'py' + format, path + 'ny' + format,
path + 'pz' + format, path + 'nz' + format
];
return new THREE.CubeTextureLoader().load(urls);
}
Appologies, perhaps I didnt explain, I dont want to rotate any objects, they should stay still. I only want to be able to rotate the enviornment/cubemap
thanks for the suggestion, I couldnt get that to work There does appear to be a rotation property on a background, but I dont seem to be able to set it?
Hmmm… I haven’t dug deep into this, but could we possibly use that to rotate HDR cube stuff as well (THREE.HDRCubeTextureLoader / THREE.PMREMGenerator / THREE.PMREMCubeUVPacker)? I haven’t found a way to rotate my PMREM HDR lighting, other than re-rendering new HDRs (I often make my own HDRs)…
It’s run into some trouble, since it was originally rejected and the person who contributed it is either busy or has forgotten about it. I’ve sent them a gentle reminder.
Hello! I created a stackoverflow question about this problem. Can you explain to me whether it is possible to rotate children of the scene, including the camera, so that the controls do not break?
On this page here, https://sbcode.net/threejs/multi-controls-example/
I have multiple controls enabled. OrbitControls, DragControls and TransformControls.
When you left click the background, the scene rotates the background image aswell.
This all done automatically using the orbitcontrols.
Example code,
const loader = new THREE.CubeTextureLoader();
const backGroundTexture = new THREE.CubeTextureLoader().load(["px.jpg", "nx.jpg", "py.jpg", "ny.jpg", "pz.jpg", "nz.jpg"]);
scene.background = backGroundTexture;
As I understand it, what people are looking for here is a way to rotate the background (and hence image based lighting) without rotating the objects in the scene. So, for example, you could simulate a sunrise if you have a sky texture and you rotate the environment, perhaps while adjusting the exposure or environment intensity at the same time.