Advertisement
Guest User

Untitled

a guest
Jul 19th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. P1.distance = (Dot.x - P1.x)^2 + (Dot.z - P1.z)^2
  2. P2.distance = (Dot.x - P2.x)^2 + (Dot.z - P2.z)^2
  3. P3.distance = (Dot.x - P3.x)^2 + (Dot.z - P3.z)^2
  4.  
  5. TotalDistance = P1.distance + P2.distance + P3.distance
  6.  
  7. P1.weight = P1.distance / TotalDistance
  8. P2.weight = P2.distance / TotalDistance
  9. P3.weight = P3.distance / TotalDistance
  10.  
  11. Dot.y = (P1.y * P1.weight) + (P2.y * P2.weight) + (P3.y * P3.weight)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement