The Z axis is the blue arrow, so I think you want to rotate around the X axis (red arrow) instead?
You can use the TransformNode.lookAt method to do it, as you have to apply a 90° correction to align the mesh with the camera (something that you can’t do with billboards):
@Evgeni_Popov I want thee blue box to spin around the pole like the yellow box does, to try to face the camera. My game has trees represented as planes, and some of them can grow along the X or Z axis.
Is this the least expensive way to get this result, though?
Also, it still bahaves slightly different when looking down from its top, the blue one spins around a little crazy, while the yellow one is stable when looking down from the top.
It seems fine to me. You can use FromLookDirectionRHToRef instead of FromLookDirectionRH to avoid some GC.
I did not reproduce with your PG, but I think it’s the gimbal lock problem. The best way to avoid it is to not allow the camera looking straight down (set constraints on camera.beta).
Which results in no “twisting around” near the center of the view, but I think this doesn’t looks as good for my use case, so maybe it’s all good as is!