How do I get the point in the triangle intersected with a ray? The dist is the distance between the intersected point in trainagle and the origin of the ray?
D3DXIntersectTri(&v_tri[0],&v_tri[1],&v_tri[2],&originW,&dirW,&U,&V,&dist);
The output U and V parameters describe the barycentric coordinates of the hit point. To convert that value back to 3D cartesian space, do:
where v0,v1,v2 are your triangle's vertices, and u,v are returned from D3DXIntersectTri.
Is the vec1 equal to vec2?