// unsere redering funktion GLvoid display ( GLvoid ) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); // Objekt drehen und bewegen glTranslatef(posx,posy,posz); glRotatef(rotx, 0.0f, 1.0f, 0.0f); glRotatef(roty, 1.0f, 0.0f, 0.0f); glRotatef(225.0f, 0.0f, 0.0f, 1.0f); // licht setzen und anzeigen glPushMatrix(); glRotatef(rotly, 1.0f, 0.0f, 0.0f); glRotatef(rotlx, 0.0f, 1.0f, 0.0f); float l[3]; l[0] = (float)apoint.x; l[1] = (float)apoint.y; l[2] = (float)apoint.z; // lichtpunkt anzeigen glColor3f( 1.0f, 1.0f, 0.0f); glPointSize(6.0f); renderPoint(apoint); glLightfv(GL_LIGHT0, GL_POSITION, l); glPopMatrix(); // bbox der datenpunkte anzeigen glColor3f( 0.0f, 1.0f, 0.0f); model->box->render(); glEnable(GL_LIGHTING); // model anzeigen glColor3f( 1.0f, 1.0f, 1.0f); // off Daten anzeigen glPointSize(2.0f); if (visModel) model->render(); if(visFacesOpt) renderFaces(model2->faces); if(visFaces) renderFaces(modelNormal->faces); glDisable(GL_LIGHTING); glColor3f( 1.0f, 1.0f, 1.0f); if(visEdgesOpt) renderEdges(model2->edges, number); if(visEdges) renderEdges(modelNormal->edges, number); //KD-tree anzeigen if(visStruktur) { glDisable(GL_DEPTH_TEST); model->visStructure(); glEnable(GL_DEPTH_TEST); } // daten raus "spülen" ;) und back/front buffer swappen glFlush(); glutSwapBuffers ( ); }
void LinearGeometry::render(float alpha, Appearance& appearance) { renderFaces(alpha, appearance); renderEdges(alpha, appearance); }