Billboards do not work as expected in XR mode

You can see how they are not “focused” on the user camera.

Also, I’ve modified a code I found in the forum and integrated it into the sample. With these changes it works ok:

But besides we can modify it on our own I think this should be considered a bug since the original code should be enough.


cc @RaananW

1 Like

I can reproduce this. it seems like when you are looking directly at a mesh its transformation is correct, but when the mesh is out of the camera’s focus it rotates incorrectly. Is that the behavior you are experiencing as well?

Exactly that’s it, it works ok when they are in the center of the screen.

1 Like

Just another fast playground to check the effect, red disc and green dist should be (more or less) aligned but they are not in VR

1 Like

I’ll debug it and fix the issue this week. thanks for the 2nd demo!

So, did some debugging - the issue is not XR. the reason you don’t see it outside of XR is the (relative) low fov a default camera has. Billboard mod is meant to be performant. i.e. - not a lookAt, but a “simple” way of applying rotation to an object. what it does, in general, is assign the invert of the camera’s current rotoation to the object at hand. If you look at the object directly, the inverted rotation is exactly what you are looking for. When you are not looking at it (note - not your pupils, but your head), the reverted rotation is a little off. To get that to be exact you will need to use lookAt.