Issues with picking

Posts: 1
Joined: 2009.11
Post: #1
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!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How do I do Color Picking? dockode 2 7,711 Sep 24, 2011 08:02 PM
Last Post: dockode
  Opengl picking problem (zip file) papillon68 1 6,456 Mar 1, 2009 08:49 PM
Last Post: chronus
  Picking and selection... chalamov33 2 5,295 Mar 31, 2008 02:08 PM
Last Post: wyrmmage
  glut picking clashes with drawing wyrmmage 2 5,136 Jan 24, 2008 06:39 PM
Last Post: wyrmmage
  picking glOrtho vs gluPerspective rhiannon 0 5,128 Jun 6, 2005 02:20 PM
Last Post: rhiannon