=DEGREES(2*ATAN(0.5*1/ThrowRatio))

Where Throw Ratio = distance/width. Cheers!

]]>Thank you!:) ]]>

mat3 rotAxis(vec3 axis, float a) {

float s=sin(a);

float c=cos(a);

float oc=1.0-c;

vec3 as=axis*s;

mat3 p=mat3(axis.x*axis,axis.y*axis,axis.z*axis);

mat3 q=mat3(c,-as.z,as.y,as.z,c,-as.x,-as.y,as.x,c);

return p*oc+q;

} ]]>

mat4 rotationMatrix(vec3 axis, float angle) {

vec3 a = normalize(axis);

float s = sin(angle);

float c = cos(angle);

float oc = 1.0 – c;

float sx = s * a.x;

float sy = s * a.y;

float sz = s * a.z;

float ocx = oc * a.x;

float ocy = oc * a.y;

float ocz = oc * a.z;

float ocxx = ocx * a.x;

float ocxy = ocx * a.y;

float ocxz = ocx * a.z;

float ocyy = ocy * a.y;

float ocyz = ocy * a.z;

float oczz = ocz * a.z;

return mat4(

vec4(ocxx + c, ocxy – sz, ocxz + sy, 0.0),

vec4(ocxy + sz, ocyy + c, ocyz – sx, 0.0),

vec4(ocxz – sy, ocyz + sx, oczz + c, 0.0),

vec4( 0.0, 0.0, 0.0, 1.0)

);

}