[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: [eigen] OpenGL support
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Thu, 22 Jul 2010 16:45:31 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=onTJrYgjD3M99v05laBPHofT0FEb0fg5aBoQmk6OVLQ=; b=ElpwUQTD7vgndDigZpQ01xD2DqSn53JzBTstOSaGzEFdIuoiJL3iA6pmsFdwzHJI56 cl7fAnc2mpmL+EoWl0V1w1TDT/7AlwLyX1qRll1d6MFtvjXq8OdHP8jEC4OnmCpav+PY iRc1ZQ6pcj0owrOYOMi2LiuMCypdr8QFztQ6k=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=m3IXF5bLVPcN754zxWjZbIrfLGfkhYiQ7tRxjvB+0t0EXyJLFm+tgrZb86Sua/iQit cGGFjdvVygKBXCZlnEsZxk66wbwAmypfyp6jCnNKhR9FGl6q7njGxIQ7L6EwgfgCA72O 5molrk3HKwXfmzIBT+QLjkgYvxC9TDJqcPck0=
Hi,
I've just adapted and pushed some old code I had to pass Eigen's
objects to OpenGL, like:
Vector3f a, b;
glVertex(0.5*(a + b));
without having to bother about the dimension, scalar type, whether I
should evaluate the expression or not, degree versus radian, row major
versus column major, etc., etc.
Currently supported functions:
glVertex, glNormal, glColor, glTexCoord (for 2D, 3D, 4D and int,
short, float and double)
glTranslate( a 2D or 3D vector expression )
glScale( a 2D or 3D vector expression )
glRotate( Rotation2D or AngleAxis or Quaternion )
glLoadMatrix( 4x4 expression of float or double which can be row or
column major )
glMultMatrix( 4x4 expression of float or double which can be row or
column major )
Feel free to improve it and send patch ;) (e.g., it would be welcome
to support Eigen::Translation, Eigen::Transform,
Eigen::UniformScaling, 2x2 and 3x3 rotation matrix via glRotate, etc.)
cheers,
gael