Expected behavior of CreateBillboard?

The thing that triggers it is just moving the camera very close to the object, say z-distance of 0.01; camera-forward and up were remaining the same. I had a look at the Matrix.cs source and it appears to be deliberate (there’s a block to handle the case of distance being less than some epsilon), but now that I’m understanding the camera convention, I’d guess it’s (as you suggested) to handle FP issues around the camera being nearly on top of the object.

(The explicit camera-forward vector was a red herring in this case, it turns out; that provides different behavior if you’re handling the camera with positive-z out of the screen, as I was. If you’re using camera at negative-z, looking toward positive, then CreateBillboard() assumes the conventional camera-forward for that test if you don’t provide it.)

1 Like