Jump to content

  • Log In with Google      Sign In   
  • Create Account


#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)

to your solution:

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)

to your solution:

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. 


PARTNERS