- Timestamp:
- Oct 25, 2005, 1:13:50 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/coord/p_node.cc
r5420 r5432 763 763 void PNode::debugDraw(unsigned int depth, float size, const Vector& color, unsigned int level) const 764 764 { 765 // if this is the first Element we draw 765 766 if (level == 0) 766 767 { 767 glPushAttrib(GL_ENABLE_BIT); 768 glMatrixMode(GL_MODELVIEW); 769 770 glDisable(GL_LIGHTING); 771 glDisable(GL_BLEND); 772 glDisable(GL_TEXTURE_2D); 773 } 774 775 glPushMatrix(); 768 glPushAttrib(GL_ENABLE_BIT); // save the Enable-attributes 769 glMatrixMode(GL_MODELVIEW); // goto the ModelView Matrix 770 771 glDisable(GL_LIGHTING); // disable lighting (we do not need them for just lighting) 772 glDisable(GL_BLEND); // '' 773 glDisable(GL_TEXTURE_2D); // '' 774 } 775 776 glPushMatrix(); // repush the Matrix-stack 776 777 /* translate */ 777 778 glTranslatef (this->getAbsCoor ().x, 778 779 this->getAbsCoor ().y, 779 780 this->getAbsCoor ().z); 781 // this->getAbsDir ().matrix (matrix); 782 780 783 /* rotate */ 781 // this->getAbsDir ().matrix (matrix);782 // glMultMatrixf((float*)matrix);783 784 784 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 785 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 786 /* set the new Color */ 785 787 glColor3f(color.x, color.y, color.z); 786 787 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 788 { 788 { /* draw a cube of size size */ 789 789 glBegin(GL_LINE_STRIP); 790 790 glVertex3f(-.5*size, -.5*size, -.5*size); … … 817 817 if (depth >= 2 || depth == 0) 818 818 { 819 /* rotate the current color in HSV space around 20 degree */ 819 820 Vector childColor = Color::HSVtoRGB(Color::RGBtoHSV(color)+Vector(20,0,.0)); 820 821 tIterator<PNode>* iterator = this->children->getIterator(); … … 836 837 glEnd(); 837 838 } 838 if (depth == 0) 839 /* if we want to draw the children too */ 840 if (depth == 0) /* -> all of them */ 839 841 pn->debugDraw(0, size, childColor, level+1); 840 else 842 else /* -> only the Next one */ 841 843 pn->debugDraw(depth - 1, size, childColor, level +1); 842 844 pn = iterator->nextElement(); … … 845 847 } 846 848 if (level == 0) 847 glPopAttrib(); 849 glPopAttrib(); /* pop the saved attributes back out */ 848 850 } 849 851
Note: See TracChangeset
for help on using the changeset viewer.