The code sandbox: https://codesandbox.io/s/friendly-cloud-c00zr?file=/src/main.js
The code in the sky.js
file is an iteration of the original sky-sun-shader
:
https://threejs.org/examples/webgl_shaders_sky.html
All that I have changed is the up
position of the sky and its geometry
from boxBuffer
to sphereBuffer
.
I’m trying to get the sky to rotate on its z-axis. For example if I rotate the sky by 180 degrees the shadow from the sun light should display in the opposite direction.
I’ve tried rotateZ
to no avail.
The point of this is to be able to have the sky point towards a hypothetical north so the sun rises and sets in the correct location.
Is there a special way to rotate ShaderMaterial
?
Many thanks in advance!