• Create Account

Banner advertising on our site currently available from just \$5!

### #ActualDDoS

Posted 23 July 2013 - 03:35 PM

i'd suggest to transform the points first by the view*model matrix, then make dot product of the point (normalized) with the view direction, probably (0,0,-1)

float k = dot(diff, vec3(-1.0f, 0.0f, 0.0f));


gives you: k = |diff| * cos(angle_between_vectors) so this is actually a projection and not the angle you want, to erase the impact from the length of diff normalize diff first.

### #1DDoS

Posted 23 July 2013 - 03:35 PM

i'd suggest to transform the points first by the view*model matrix, then make dot product of the point (normalized) with the view direction, probably (0,0,-1)

float k = dot(diff, vec3(-1.0f, 0.0f, 0.0f));