About Store Forum Documentation Contact



Post Reply 
Color of mesh texture hit by ray
Author Message
Esenthel Offline
Administrator

Post: #31
RE: Color of mesh texture hit by ray
If you want to use more precise barycentric interpolation, you should use 'TriBlend' (and not your current Lerp)

See the following example: (just put this into Draw) to see how it works
Code:
Tri2 tri(Vec2(-1,1), Vec2(1,1), Vec2(-1,-1));
   tri.draw();
   Vec b=TriBlend(Ms.pos(), tri);

   (tri.p[0]*b.x + tri.p[1]*b.y + tri.p[2]*b.z).draw(RED);

   D.text(0,0,S+b);
05-27-2014 10:00 PM
Find all posts by this user Quote this message in a reply
Post Reply