Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualBacterius

Posted 03 January 2013 - 09:55 AM

Ah, all good then, the code is just saving some divisions by doing them at the end, your barycentric coordinates are just v / d and w / d (and 1 - v / d - w / d). Try using those and see if they are within the required bounds, then try to apply the formula (make sure to associate the correct uv coordinates with the correct barycentric coordinate, otherwise it'll be off). As far as I can see this should be correct now.

 

If you care about performance, you can compute 1 / d first, then you just have to multiply a few times, which is faster. 


#1Bacterius

Posted 03 January 2013 - 09:54 AM

Ah, all good then, the code is just saving some divisions by doing them at the end, your barycentric coordinates are just v / d and w / d. Try using those and see if they are within the required bounds, then try to apply the formula (make sure to associate the correct uv coordinates with the correct barycentric coordinate, otherwise it'll be off). As far as I can see this should be correct now.

 

If you care about performance, you can compute 1 / d first, then you just have to multiply a few times, which is faster. 


PARTNERS