Hi everyone,
I am trying to interface the space pilot for a program in OpenGL. Any out there having any views and suggestions are requested to share it. Thank you.
U can mail me to [email protected]
Interfacing Space Pilot using OpenGL
Moderator: Moderators
You have a couple of directions depending on the structure of the app.
If the app makes use of COM, it may be easiest to use our 3DxInput COM API.
If it is a Win32 or MFC app, you can use our "old SDK" (from the download...archive section of the web page).
If it is a game, you may find that DirectInput will be the easiest integration method.
If it doesn't have a GUI, you may have to use HID or RawInput.
If the app makes use of COM, it may be easiest to use our 3DxInput COM API.
If it is a Win32 or MFC app, you can use our "old SDK" (from the download...archive section of the web page).
If it is a game, you may find that DirectInput will be the easiest integration method.
If it doesn't have a GUI, you may have to use HID or RawInput.
Support for OpenGLUT (win32)
I have included the code of the 3DxTest32 example in OpenGLUT and I have added two call-back functions:
and
In this way, the minimal example is as simple as:
I am now working at the Linux version, but I have still some problems with the call-backs (besides the fact that, to keep up-to-date the display, I must put a call to glutPostRedisplay in the glutIdleFunc, but this happens also in the original code). I do not own a Mac, so by now that OS is not in my plans, a closer objective would be the inclusion into the GL C++ Toolkit.
I will donate the source code to the original project, which is now "dormant"; meanwhile I have put the library here: http://www.dei.unipd.it/~hyksos/OpenGLUT_sb.zip
Code: Select all
void glutSpaceballButtonFunc(int button, int state);Code: Select all
void glutSpaceballMotionFunc(int tx, int ty, int tz, int rx, int ry, int rz);Code: Select all
#include <GL>
#include <stdio>
void sbButton(int button, int state)
{
printf("%d, %d\n", button, state);
}
void sbMotion(int tx, int ty, int tz, int rx, int ry, int rz)
{
printf("%d, %d, %d, %d, %d, %d\n", tx, ty, tz, rx, ry, rz);
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (500, 500);
glutInitWindowPosition (100, 100);
glutCreateWindow (argv[0]);
glutSpaceballButtonFunc (sbButton);
glutSpaceballMotionFunc (sbMotion);
glutMainLoop();
return 0;
}I will donate the source code to the original project, which is now "dormant"; meanwhile I have put the library here: http://www.dei.unipd.it/~hyksos/OpenGLUT_sb.zip
I have completed the Linux version for OpenGLUT and I have also applied the support to FreeGLUT: now there is a starting point for developing with SpaceNavigator in Windows and Linux using OpenGL. You can find the precompiled libraries here:
I have sent the code to the FreeGLUT developers, in the hope that they will include it in future versions and they will add OSX support.
I have sent the code to the FreeGLUT developers, in the hope that they will include it in future versions and they will add OSX support.
