I'm in trouble trying to do object billboarding to display bones hierarchy.
Question 1 : should I do the billboarding first and then TRS to match the bone position rotation and size or, should I do the TRS first, which I've done already and then rotate around bone axis to align the bone mesh in front of the camera ?
Question 2 : I'm trying to do billboarding with a mesh, here are my steps:
1- get the vector object to cam in world space
2- project it on XZ plan by setting its y component to 0
3- normalize it (objToCamProj)
4- get alpah the dot between forward(0, 0, 1) and objToCamProj
5- get the up vector from cross(forward, objToCamProj)
6- create a rotation axis out of up and rotate each vertex by acos(alpha)
7- transform vertexPos by the model, view and proj mat
Ok now I think the method should be correct BUT, when rotating the camera around my object, it's fine as long as I'm within the positive Z. As soon as the cam pos is going into negative Z, the rotation angle seams like inverse or something.
What am I missing ? (I know for now it's only cylindrical billboard and regarding question 1 I'm doing billboard then TRS)
Any help would be much appreciated.