Hi,
I work on raytracing project and i have few questions:
When i use :
tmp contains the result as barycentric coordinate.Code :glm::intersectLineTriangle(rayon->Direction,ray->Origine, m_Model->listVertex[m_Model->listFaces[i].s1], m_Model->listVertex[m_Model->listFaces[i].s2], m_Model->listVertex[m_Model->listFaces[i].s3], tmp)
As i understand barycentric result:
tmp.x,tmp.y and tmp.z sould be between 0 and 1 if the line interssect the triangle.
and must be right tmp.x+tmp.y+tmp.z=1
But when i run my code, results are different:
ie : tmp.x+tmp.y+tmp.z=
is this normal?Code :1.11251 0.827902 0.582208 1.03863 0.587821 1.12883 0.649694 1.10107 0.522131 0.409886 1.09019 0.98119 0.805814 0.701678 0.484763 0.969776 0.883093 1.12744