+ count = cmesh_submesh_count(scn);
+ for(i=0; i<count; i++) {
+ cmesh_draw_submesh(scn, i);
+ }
+
+ glPushMatrix();
+ glMultMatrixf(gouter_xform);
+ cmesh_draw(mesh_gout);
+ glPopMatrix();
+
+ glPushMatrix();
+ glMultMatrixf(ginner_xform);
+ cmesh_draw(mesh_gin);
+ glPopMatrix();
+
+ /*cmesh_draw(mesh_suz);*/
+
+ glPointSize(7);
+ glBegin(GL_POINTS);
+ for(i=0; i<4; i++) {
+ glVertex3f(dbgvec[i].x, dbgvec[i].y, dbgvec[i].z);
+ }
+ glEnd();
+
+ glPushAttrib(GL_ENABLE_BIT);
+ glDisable(GL_LIGHTING);
+ glLineWidth(2);
+ glPointSize(5);
+
+ rope = rsim.ropes;
+ while(rope) {
+ glBegin(GL_LINES);
+ glColor3f(0.2, 1, 0.2);
+ for(i=0; i<rope->num_masses; i++) {
+ for(j=i+1; j<rope->num_masses; j++) {
+ if(rsim_have_spring(rope, i, j)) {
+ glVertex3f(rope->masses[i].p.x, rope->masses[i].p.y, rope->masses[i].p.z);
+ glVertex3f(rope->masses[j].p.x, rope->masses[j].p.y, rope->masses[j].p.z);
+ }
+ }
+ }
+ glEnd();
+
+ glBegin(GL_POINTS);
+ glColor3f(1, 0.2, 0.2);
+ for(i=0; i<rope->num_masses; i++) {
+ glVertex3f(rope->masses[i].p.x, rope->masses[i].p.y, rope->masses[i].p.z);
+ }
+ glEnd();
+ rope = rope->next;
+ }
+ glPopAttrib();