Dart Topo3PrimalRender<PFP>::pickColor(unsigned int x, unsigned int y) { //more easy picking for unsigned int dw = m_topo_dart_width; m_topo_dart_width+=2; // save clear color and set to zero float cc[4]; glGetFloatv(GL_COLOR_CLEAR_VALUE,cc); glClearColor(0.0f,0.0f,0.0f,0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glDisable(GL_LIGHTING); // draw in back buffer (not shown on screen) drawDarts(); // restore dart with m_topo_dart_width = dw; // read the pixel under the mouse in back buffer glReadBuffer(GL_BACK); float color[3]; glReadPixels(x,y,1,1,GL_RGB,GL_FLOAT,color); glClearColor(cc[0], cc[1], cc[2], cc[3]); std::cout << color[0] << ", "<<color[1] << ", "<<color[2] <<std::endl; return colToDart(color); }
void Topo3Render::drawTopo() { drawDarts(); drawRelation1(); drawRelation2(); drawRelation3(Geom::Vec4f(1.0f,1.0f,0.0f,0.0f)); }
void Topo3PrimalRender<PFP>::drawTopo() { drawDarts(); drawRelation2(); }
void TopoRender::drawTopo() { drawDarts(); drawRelation1(); drawRelation2(); }