- //now that we have our lumel array, get the lumel quad back on the triangle
- //plane
- //So, we get the intersection point with our triangle, if there is any...
- //define our triangle conform MagicFM library
- MgcT.Origin() = Triangle.Vertex[0];
- MgcT.Edge0() = Triangle.Vertex[1]-Triangle.Vertex[0];
- MgcT.Edge1() = Triangle.Vertex[2]-Triangle.Vertex[0];
- //for every lumel
- for(i=0; i< LMHEIGHT; i++)
- {
- for(int j=0; j<LMWIDTH; j++)
- {
- //origin
- line.Origin() = lumels[j][i];
- //direction
- if(ProjType==XY)
- {
- line.Direction() = Vector3(0,0,1);
- }
- else if(ProjType==XZ)
- {
- line.Direction() = Vector3(0,1,0);
- }
- else if(ProjType==YZ)
- {
- line.Direction() = Vector3(1,0,0);
- }
- //find point on our triangle
- if(FindIntersection(line, MgcT, pointofintersection))
- {
- lumels[j][i] = pointofintersection;
- } else { /*Keep current coordinates, don't really need
- them anyway*/ }
- }
- }