Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#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