drei
drei copied to clipboard
Billboard doesn't work when 2 axis are locked
Problem description:
Let's say I want to create a traffic sign which is always facing to the camera. I want to rotate it only around the Y axis, so it stays vertical. So I set lockX and lockZ on Billboard. What I expect in this scenario is that the sign rotates around the Y axis following the camera. The problem is it doesn't after a certain point.
Relevant code:
https://drei.pmnd.rs/?path=/story/abstractions-billboard--billboard-story&args=lockX:true;lockZ:true
- Set lockX, lockZ to true and lockY to false.
- With your pointer rotate the scene in the left/right directions and try to make a full circle.
- At some point you'll see that the Billboard is not facing to the camera any more as it "flips".
Suggested solution:
Make the "flip" transparent to the user so that it actually always faces the camera.