VOID DebugDraw::DrawBound( const Bound& bound, D3DCOLOR Color )
{
    switch( bound.GetType() )
    {
        case Bound::Sphere_Bound:
            DrawSphere( bound.GetSphere(), Color );
            return;
        case Bound::Frustum_Bound:
            DrawFrustum( bound.GetFrustum(), Color );
            return;
        case Bound::AABB_Bound:
            DrawAabb( bound.GetAabb(), Color );
            return;
        case Bound::OBB_Bound:
            DrawObb( bound.GetObb(), Color );
            return;
    }
}
void FeatureTracker::glDraw()
{

//    static int lastt = 0;
//    static int idx=0;
//    lastt++;
//    if(lastt > 100)
//    {
//        lastt = 0;
//        idx = RAND(0,features.size()-1);
//    }

//    if(idx >0 && idx < features.size())
//    {
//        glLineWidth(5);
//        glColor3f(1,0,0);
//        glBegin(GL_LINES);
//        glVertex3f(features[idx].view[0]-features[idx].size,features[idx].view[1],features[idx].view[2]);
//        glVertex3f(features[idx].view[0]+features[idx].size,features[idx].view[1],features[idx].view[2]);
//        glEnd();

//        glBegin(GL_POINTS);
//        glVertex3f(features[idx].pos[0],features[idx].pos[1],features[idx].pos[2]);
//        glEnd();
//    }

    DrawFrustum(pose, /*5*/pose[2]-0.2);

    //std::vector<Feature> fs = MatchedFeatures(pose);
    std::vector<Feature> fs = features;

    glColor3f(1,0,0);
    glPointSize(5);

    if(false)
    {
        for(int i=0; i<fs.size(); i++)
        {
            glPointSize(5*fs[i].size);
            glBegin(GL_POINTS);
            glVertex3f(fs[i].pos[0], fs[i].pos[1], fs[i].pos[2]+0.01);
            glEnd();
        }
    }
    // draw matched features
//    glColor3f(1,0,1);
//    for(int i=0; i<matchedFeatures.size(); i++)
//    {
//        glPointSize(10*matchedFeatures[i].size);
//        glBegin(GL_POINTS);
//        glVertex3f(matchedFeatures[i].pos[0], matchedFeatures[i].pos[1], matchedFeatures[i].pos[2]+0.01);
//        glEnd();
//    }




//    if(bDrawEntropy)
//    {
//        //Draw entropy field
//        glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
//        for(int i=0; i< entropies.size(); i++)
//        {
//            glColor4f(0,0,1,entropies[i]/mesh.maxEntropy);
//            Vector<3, double > p1 = makeVector(nextPath[i][0]-footprint_length/4, nextPath[i][1]+footprint_length/4, nextPath[i][2]);
//            Vector<3, double > p2 = makeVector(nextPath[i][0]+footprint_length/4, nextPath[i][1]-footprint_length/4, nextPath[i][2]);

//            glBegin(GL_POLYGON);
//            glVertex3f(p1[0], p1[1], p1[2]);
//            glVertex3f(p2[0], p1[1], p2[2]);
//            glVertex3f(p2[0], p2[1], p2[2]);
//            glVertex3f(p1[0], p2[1], p2[2]);
//            glEnd();
//        }
//    }
}