The original GLUT library used to support some less well-known input devices under IRIX, such as the Spaceball, a true 3D input device which can be used to control all 6 degrees of freedom (3 axis of rotation and 3 axis of translation) simultaneously. Unfortunately, nowadays, the more “exotic” input callbacks of GLUT such as the spaceball are left unimplemented.
So, yesterday I sat down and implemented the missing spaceball bits of FreeGLUT, which is the most widely used free GLUT implementation.
To avoid adding any extra dependencies to freeglut, I just ripped the relevant code from libspnav, which is part of my free spacenav driver project, and added it directly into freeglut.
Here’s the patch against the current freeglut svn head, as well as instructions on how to check out freeglut and apply it.
I’ve also submitted it to the freeglut-devel mailing list, so hopefully they’ll merge it and we’ll have spaceball input callbacks available with the prepackaged glut that comes with any GNU/Linux distribution in the future.
November 3, 2009 at 3:14 am
Hello,
Thank you so much !!! I want to develop a GLUT application under Debian Lenny and to use the SpacePilot of 3D Connexions.
Then i needed the 3 functions glutSpaceballButtonFunc(), glutSpaceballMotionFunc () and glutSpaceballRotateFunc (), which are not (yet) implemented in FreeGLUT.
Current version is 833, the command to download should now be:
svn co https://freeglut.svn.sourceforge.net/svnroot/freeglut/trunk/freeglut/freeglut -r 832
Thanks again for your great work ! Hope FreeGLUT will add your patch to official version.
Guillaume
November 3, 2009 at 3:25 am
PS:
1) On this page http://spacenav.sourceforge.net/glut/
you should precise that the patch must be copied and applied in the “freeglut” directory (obtained from svn)
2) The command “make install” installs freeglut in /usr/local/
then -I /usr/local/include must be added to gcc or g++
November 9, 2009 at 1:06 am
The patch has been commited to the freeglut subversion repository (rev 837 and up), and should make it into the next freeglut 2.6.0 release (which I understand should be out shortly).
Btw, where freeglut is installed can be controlled by passing the –prefix=/what/ever/path argument to the configure script. However /usr/local/include should be in the default search path. At least it is on my system.