drei icon indicating copy to clipboard operation
drei copied to clipboard

Billboard doesn't work when 2 axis are locked

Open la55u opened this issue 3 years ago • 0 comments

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

  1. Set lockX, lockZ to true and lockY to false.
  2. With your pointer rotate the scene in the left/right directions and try to make a full circle.
  3. 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.

la55u avatar Jul 29 '22 10:07 la55u