For instance, when a rotation of : new Euler(Math.PI / 2, 0, 0); is applied, the current behavior would work with the following:
pos.z -= (cameraPosition.y * followCamera);```
A first implementation could be to have the possibility to chose the grid direction between 'xy','xz' or 'yz'.
A second implementation could alow any rotation.
It could be done by using a uniform that store the current grid rotation.
three
version: 0.150.1@react-three/fiber
version: 8.12@react-three/drei
version: 9.58.4Problem description:
When adding a rotation value in the grid props, the followCamera props is not working the same as when rotation is not defined.
Relevant code:
Here is the codesandbox of the reproduction based on your demo for the grid
Suggested solution:
the following line should take into account the orientation applied:
https://github.com/pmndrs/drei/blob/589b10422d37a0af5387b0479d52cf79771d9ee7/src/core/Grid.tsx#L69
For instance, when a rotation of :
new Euler(Math.PI / 2, 0, 0);
is applied, the current behavior would work with the following: