I'm trying to find a way to easily render billboards (ie. quads that are always looking exactly at the camera)! The only method I can find is to use the inverse view matrix of the camera as the billboards world matrix (without the translation part of the matrix). That works fine but means that my billboards always even roll with the camera when it rolls itself.
What I need is a method that will have my billboards looking at my camera but still maintain their roll! If you picture a 2D sprite of a barrel in an old-school first-person shooter, for example, if you could roll your camera in these games, the barrel should not 'rotate along' with the camera's roll, the barrel should still stand perpendicular to the ground even when the camera is rolling!
My idea was to find the roll components of that inverse view matrix and set them to 0,0,0 or whatever just like you do with the translation but I wasn't able to get that working, it either completely broke the billboarding or didn't make a difference at all. My main problem here is that I just can't find any decent information on how d3d9 even lays out view matrices...
I'm using D3D9 so it's row vectors from what I know!
I hope I was able to make my question clear (it is kinda hard to describe), if anything doesn't make sense, let me know and I'll gladly update with more info. Thanks ahead of time!
Edited by d k h, 07 June 2012 - 01:54 PM.