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();
62 glTranslatef(position.x(), position.y(), position.z());
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();
83 glTranslatef(position.x(), position.y(), position.z());
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]);
void drawUnitSphere(int level=0)
GLenum mCurrentMatrixTarget
void pushProjectionMode2D(ProjectionMode2D pm)
void drawVectorBox(const Vector3f &position, const Vector3f &vec, const Color &color, float aspect=50.)
void popMatrix(GLenum matrixTarget)
void pushMatrix(const Matrix< Scalar, 4, 4, _Flags, 4, 4 > &mat, GLenum matrixTarget)
void popProjectionMode2D()
void drawVector(const Vector3f &position, const Vector3f &vec, const Color &color, float aspect=50.)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
EIGEN_DEVICE_FUNC const AcosReturnType acos() const
Point3 position(const NavState &X, OptionalJacobian< 3, 9 > H)