No matter if I import the scene or create every mesh and light through code, the issue remains the same.
My scene consists of a plane, a cube, and a spot light. The spot light is rotated 45 degrees on the y-axis. In the first example, it is positioned at (4, 0, 4). In the second example, it is positioned at (4, 0, 5).
The rotation of the light always remains at 45 degrees (0.785398163 radians).
Why does the light consistently point towards the center of the front face of the cube? I would expect it to render example 2 exactly as it appears in Blender, pointing towards the edge of the cube.
Here are the two examples:
First Example (correct rotation):
This is the scene in Blender:
And this is how it renders in ThreeJS:
Second Example (incorrect rotation):
This is the scene in Blender:
But this is how it ends up rendering in ThreeJS: