iDevGames Forums
Issues with picking - Printable Version

+- iDevGames Forums (
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Issues with picking (/thread-575.html)

Issues with picking - FFaqui - Nov 21, 2009 04:37 PM

I'm designing a program so that you can color the model by using picking. However, whenever I draw on the model, it appears on the back of the model at strange places. I don't know if I'm doing the ray-triangle intersection correctly. Here is my code:

bool isViewIntersect(vertex sPos0, vertex sPos1, vertex v0, vertex v1, vertex v2,vertex &center)
    vertex e1,e2,direction,h,s,q;
    float a,u,v,intersect;


    if(a>-0.00001 && a<0.00001)
        return false;
    if(u<0.0 || u>1.0)
        return false;
    if(v <0.0 || u+v>1.0)
        return false;
        cout << center.x << " " << center.y << " " << center.z << endl;
        return true;
    return false;

Please help! Thank you!