34 pushMatrix(Matrix4f::Identity(),GL_PROJECTION);
43 glGetIntegerv(GL_VIEWPORT, vp);
44 glOrtho(0., vp[2], 0., vp[3], -1., 1.);
58 static GLUquadricObj *cylindre = gluNewQuadric();
59 glColor4fv(color.data());
60 float length = vec.norm();
63 Vector3f ax = Matrix3f::Identity().col(2).cross(vec);
67 float angle = 180.f/
M_PI *
acos(tmp.z());
69 glRotatef(angle, ax.x(), ax.y(), ax.z());
70 gluCylinder(cylindre, length/aspect, length/aspect, 0.8*length, 10, 10);
71 glTranslatef(0.0,0.0,0.8*length);
72 gluCylinder(cylindre, 2.0*length/aspect, 0.0, 0.2*length, 10, 10);
79 static GLUquadricObj *cylindre = gluNewQuadric();
80 glColor4fv(color.data());
81 float length = vec.norm();
84 Vector3f ax = Matrix3f::Identity().col(2).cross(vec);
88 float angle = 180.f/
M_PI *
acos(tmp.z());
90 glRotatef(angle, ax.x(), ax.y(), ax.z());
91 gluCylinder(cylindre, length/aspect, length/aspect, 0.8*length, 10, 10);
92 glTranslatef(0.0,0.0,0.8*length);
93 glScalef(4.0*length/aspect,4.0*length/aspect,4.0*length/aspect);
100 static float vertices[][3] = {
111 glNormal3f(0,0,-1); glVertex3fv(vertices[0]); glVertex3fv(vertices[2]); glVertex3fv(vertices[3]); glVertex3fv(vertices[1]);
112 glNormal3f(0,0, 1); glVertex3fv(vertices[4]); glVertex3fv(vertices[5]); glVertex3fv(vertices[7]); glVertex3fv(vertices[6]);
113 glNormal3f(0,-1,0); glVertex3fv(vertices[0]); glVertex3fv(vertices[1]); glVertex3fv(vertices[5]); glVertex3fv(vertices[4]);
114 glNormal3f(0, 1,0); glVertex3fv(vertices[2]); glVertex3fv(vertices[6]); glVertex3fv(vertices[7]); glVertex3fv(vertices[3]);
115 glNormal3f(-1,0,0); glVertex3fv(vertices[0]); glVertex3fv(vertices[4]); glVertex3fv(vertices[6]); glVertex3fv(vertices[2]);
116 glNormal3f( 1,0,0); glVertex3fv(vertices[1]); glVertex3fv(vertices[3]); glVertex3fv(vertices[7]); glVertex3fv(vertices[5]);