Пример #1
0
void glMouse(int button, int state, int x, int y)
{
    g_mouseX = x;
    g_mouseY = y;
    g_mouseState = state;
    if (state == GLUT_DOWN)
    {
        g_mouseButton = button;
        selectFace(x, y);
    }
}
Пример #2
0
bool SubdivScene::selectVertex(int x, int y, int width, int height, float fovy) {
    Face* f = selectFace(x,y,width, height, fovy);

    if (!f)
      return false;

    //select from the 3 quads corresponding the face selected.  
    int faceHit = select(x,y,width, height, fovy, f);

    if (faceHit<0) {
      printf("ERROR: found a face but not a vertex in selectVertex");
      return false;
    }
    
    this->selectedVertex = (*f)[ (unsigned int) faceHit];
    return true;
}