Good eve all!
I'm making simple model editor on WPF for creating cube-head freaks with pixelate skins and want add billboarding to it.
So, what I do
Vector3D unitZ = new Vector3D(0, 0, 1);
Vector3D direction = -this.camera.LookDirection;
double yaw = Vector3D.AngleBetween(unitZ, new Vector3D(0, 0, direction.Z));
and the apply rotation to plane. It works, but only on half, couse AngleBetween function allways returns positive values. So when I rotate parent shape to -45 degrees AngleBetween returns 45 and it annihilate parent rotation. But when I rotate parent on 45 degrees AngleBetween again returns 45 and in result I got 90 degrees rotation.
Any solutions?
And one more thing: please, do not offer any frameworks or toolkits! Thanks.