Java-based development for the SpaceBall 5000

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

Dan
Posts: 7
Joined: Thu Dec 14, 2006 12:03 am

ask for help for the spaceball 5000?

Post by Dan »

I am a graduate student of the Virtual Reality Lab in Southwest Jiaotong University, China. I have been trying to write the Java-based driver program for SpaceBall5000 since this June. This work takes me a lot of time. Unfortunately, up to now I have not settled it down.
I downloaded one driver program for Spaceball 4000, and modified it to obtain the Spaceball 5000 driver. However, I always failed in running the program of Spaceball4000Test.java. Following are two main problems I met:

1. I am wondering if the self-defined parameters in the programs of SpaceballPacket.java and Spaceball4000Packet, such as BALL_DATA=0x44,BUTTON_DATA=0x4B, are related to the version of Spaceball? If so, how to find these inter parameters? I search for them through Internet but cannot find useful data. I found if BALL_DATA=0x64 and BUTTON_DATA=0x6B, then the data of the press keys and control ball can be read out, but the data of the control ball almost doesn’t change.

2.The character-string is defined in the method of program of Spaceball4000Test.java.
driver.emitPatternedBeep
(
new char[]{'a','A','m','M','d','D','z','Z'}
);

I am wondering if its function is only to control the length of sound, and it has nothing to do with other orders? I tried to replace the character-string 'm','M', leading to the failure in reading the control ball data.
UtaSH
Moderator
Moderator
Posts: 3754
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Post by UtaSH »

Hello Dan,

unfortunately we can not give you support for the Java driver for the Spacball 4000, because this is from someone else. For support please contact the person who created this package.

Please be aware that the protocol of the Spaceball 4000 and the SpaceBall 5000 are totally different.

We do have a SDK for Unix (http://www.3dconnexion.com/support/4h.php) that sends the data of the device via XClientMessages to an application. When you implement the interface from this SDK you can always use any of our supported devices and can have updates if new devices are released.

Uta Ludwig
3Dconnexion
ngomes
Moderator
Moderator
Posts: 3321
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Post by ngomes »

Hi Dan,

We moved this topic in here since you are developing on Windows and not on UNIX/Linus as we first assumed.

Our SDK on Windows uses the same interface for all devices. In the words, the codes that you get are not device specific in terms of how the data needs to be processed.
We suggest you to download the SDK from our web (if you have not already done so) and look in the HTML documentation. The meaning of the codes (bitfields) when processing button events is detailed in there.
Nuno Gomes
Dan
Posts: 7
Joined: Thu Dec 14, 2006 12:03 am

Post by Dan »

Hi,Uta Ludwig
Thank you for your reply. How can I know the protocol of SpaceBall 5000?
I wonder if you have the list of the self-defined parameters which drives the events of Spaceball 5000, such as emitting sounds. Would you provide it to me for study? Thank you in advance.

Dan
uludwig wrote:Hello Dan,

unfortunately we can not give you support for the Java driver for the Spacball 4000, because this is from someone else. For support please contact the person who created this package.

Please be aware that the protocol of the Spaceball 4000 and the SpaceBall 5000 are totally different.

We do have a SDK for Unix (http://www.3dconnexion.com/support/4h.php) that sends the data of the device via XClientMessages to an application. When you implement the interface from this SDK you can always use any of our supported devices and can have updates if new devices are released.

Uta Ludwig
3Dconnexion
UtaSH
Moderator
Moderator
Posts: 3754
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Post by UtaSH »

Hello Dan,

unfortunately we don't send out the protocol of our devices.
To implement our devices into your application you can use our :arrow: SDK. There is an interface for external applications to get the data that is sent by the device. A new version of our SDK is planned for the first quarter of next year. Please check our website from time to time to be informed about the newest updates.

Thanks for your interest and feedback!

Uta
3Dconnexion
Dan
Posts: 7
Joined: Thu Dec 14, 2006 12:03 am

Post by Dan »

Hi Uta,

Thanks for your help. I have read the SDK you mentioned. I found all the samples are Win32 or MFC programs, but what I need are console programs. If you have these kinds of programs, could you provide me one or several for reference? Thank you in advance.

Dan


uludwig wrote:Hello Dan,

unfortunately we don't send out the protocol of our devices.
To implement our devices into your application you can use our :arrow: SDK. There is an interface for external applications to get the data that is sent by the device. A new version of our SDK is planned for the first quarter of next year. Please check our website from time to time to be informed about the newest updates.

Thanks for your interest and feedback!

Uta
3Dconnexion
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hi Dan,

Do you mean console as in Windows console (no GUI, no Windows main loop), or console as in xbox 360/ps3/Wii?

If the former, there is some sample Java code that you may be able to use on:

ftp://ftp-us.3dconnexion.com/jni
login: jni
password: dev1221

JNIsiapp.zip contains a JNI version of the 3Dconnexion siapp static library that is used by the 3DxWare Windows SDK. It implements most of the functions from the Windows C++ SDK. I'll admit I've only tested the ones in the sample code (JNIsiappThread.java). Obviously the siapp static library became a DLL for Java (JNIsiapp.dll). There is a HelloUniverse program in the src directory that exercises the interface. The reading of the device is in JNIsiappThread.java. The assumption is that you will have a thread dedicated to handling the device. Your code will wait for input in a call to JNIsiapp.SiWaitForEvent, then get the data from JNIsiapp.SiGetEvent. Make sure to call SiClose and SiTerminate or kill your thread or your thread won't return from the wait.

In addition to this code, I think you also need to install the 3DxWare SDK and the driver from our website. All of these pieces are free from any licensing obligations.

HelloSpacemouse3DxWare.zip is a version of the Java3D HelloSpacemouse program from the net that uses the 3DxWare driver instead of going to the serial port. The changes are limited to the pollAndProcessInput method of the SpacemouseDevice class. If you use this method, you will be able to support any 3Dx device that the driver supports, but, of course, you are limited to Windows.

If you use this and make changes, or create examples, that might help others, please post your changes.

Have fun!

Jim
3Dx Software Development
Dan
Posts: 7
Joined: Thu Dec 14, 2006 12:03 am

Post by Dan »

Hi Jim,
Thank you very much. I have downloaded the packages you provided for me. The programs are just what I need. I will develop some samples for Spaceball 5000 in the coming several weeks and give you message when I finish that. Wish a merry Christmas!

Dan
jwick wrote:Hi Dan,

Do you mean console as in Windows console (no GUI, no Windows main loop), or console as in xbox 360/ps3/Wii?

If the former, there is some sample Java code that you may be able to use on:

ftp://ftp-us.3dconnexion.com/jni
login: jni
password: dev1221

JNIsiapp.zip contains a JNI version of the 3Dconnexion siapp static library that is used by the 3DxWare Windows SDK. It implements most of the functions from the Windows C++ SDK. I'll admit I've only tested the ones in the sample code (JNIsiappThread.java). Obviously the siapp static library became a DLL for Java (JNIsiapp.dll). There is a HelloUniverse program in the src directory that exercises the interface. The reading of the device is in JNIsiappThread.java. The assumption is that you will have a thread dedicated to handling the device. Your code will wait for input in a call to JNIsiapp.SiWaitForEvent, then get the data from JNIsiapp.SiGetEvent. Make sure to call SiClose and SiTerminate or kill your thread or your thread won't return from the wait.

In addition to this code, I think you also need to install the 3DxWare SDK and the driver from our website. All of these pieces are free from any licensing obligations.

HelloSpacemouse3DxWare.zip is a version of the Java3D HelloSpacemouse program from the net that uses the 3DxWare driver instead of going to the serial port. The changes are limited to the pollAndProcessInput method of the SpacemouseDevice class. If you use this method, you will be able to support any 3Dx device that the driver supports, but, of course, you are limited to Windows.

If you use this and make changes, or create examples, that might help others, please post your changes.

Have fun!

Jim
3Dx Software Development
Dan
Posts: 7
Joined: Thu Dec 14, 2006 12:03 am

Post by Dan »

Hi Jim,
I have tested the program using Spaceball5000 in application program, but there is another problem that the spaceball cannot function in the applet of "HelloSpacemouse.java" embeded in web page. Have you ever face such a problem? How can I solve it? Thank you for your time.

Dan
jwick wrote:Hi Dan,

Do you mean console as in Windows console (no GUI, no Windows main loop), or console as in xbox 360/ps3/Wii?

If the former, there is some sample Java code that you may be able to use on:

ftp://ftp-us.3dconnexion.com/jni
login: jni
password: dev1221

JNIsiapp.zip contains a JNI version of the 3Dconnexion siapp static library that is used by the 3DxWare Windows SDK. It implements most of the functions from the Windows C++ SDK. I'll admit I've only tested the ones in the sample code (JNIsiappThread.java). Obviously the siapp static library became a DLL for Java (JNIsiapp.dll). There is a HelloUniverse program in the src directory that exercises the interface. The reading of the device is in JNIsiappThread.java. The assumption is that you will have a thread dedicated to handling the device. Your code will wait for input in a call to JNIsiapp.SiWaitForEvent, then get the data from JNIsiapp.SiGetEvent. Make sure to call SiClose and SiTerminate or kill your thread or your thread won't return from the wait.

In addition to this code, I think you also need to install the 3DxWare SDK and the driver from our website. All of these pieces are free from any licensing obligations.

HelloSpacemouse3DxWare.zip is a version of the Java3D HelloSpacemouse program from the net that uses the 3DxWare driver instead of going to the serial port. The changes are limited to the pollAndProcessInput method of the SpacemouseDevice class. If you use this method, you will be able to support any 3Dx device that the driver supports, but, of course, you are limited to Windows.

If you use this and make changes, or create examples, that might help others, please post your changes.

Have fun!

Jim
3Dx Software Development
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hi Dan,

What problem are you having that indicates that it won't work? Does it never get events? If so, it is probably because the driver can't find your applet insidet the web page. There is a function called SiGrabDevice that you can use to tell the driver to send all events to your app regardless of where keyboard focus is. This way you will always get events while your app is running.

Let me know if this fixes your issue.

Jim
3Dx Software Development
Dan
Posts: 7
Joined: Thu Dec 14, 2006 12:03 am

Post by Dan »

Hi Jim,
Thank you very much. I have tried to call the function SiGrabDevice, but the applet still cannot work in the html page. Would you embed your program in the web page by yourself? You may find the problem I indicated.

Dan
jwick wrote:Hi Dan,

What problem are you having that indicates that it won't work? Does it never get events? If so, it is probably because the driver can't find your applet insidet the web page. There is a function called SiGrabDevice that you can use to tell the driver to send all events to your app regardless of where keyboard focus is. This way you will always get events while your app is running.

Let me know if this fixes your issue.

Jim
3Dx Software Development
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hi Dan,
What happens in an html page?
I don't have a java build environment now, so I can't debug it.
One thing to check: If you have 3DxOffice installed, uninstall it. Look in the Add/Remove Panel. It will steal all the events being sent to an IE window.

Jim
Dan
Posts: 7
Joined: Thu Dec 14, 2006 12:03 am

Post by Dan »

Hi Jim,
Thank you for your help. I have tested other similar JNI programs related to win32 variables and found it was difficult to embed them in html page. I guess that the problem may has something to do with win32 variables in JNI program. I will try to write some Java programs by myself and test them in future. Thank you again.

Dan
birger
Posts: 3
Joined: Tue Jan 31, 2017 12:18 pm

Re:

Post by birger »

jwick wrote:Hi Dan,

Do you mean console as in Windows console (no GUI, no Windows main loop), or console as in xbox 360/ps3/Wii?

If the former, there is some sample Java code that you may be able to use on:

ftp://ftp-us.3dconnexion.com/jni
login: jni
password: dev1221

JNIsiapp.zip contains a JNI version of the 3Dconnexion siapp static library that is used by the 3DxWare Windows SDK. It implements most of the functions from the Windows C++ SDK. I'll admit I've only tested the ones in the sample code (JNIsiappThread.java). Obviously the siapp static library became a DLL for Java (JNIsiapp.dll). There is a HelloUniverse program in the src directory that exercises the interface. The reading of the device is in JNIsiappThread.java. The assumption is that you will have a thread dedicated to handling the device. Your code will wait for input in a call to JNIsiapp.SiWaitForEvent, then get the data from JNIsiapp.SiGetEvent. Make sure to call SiClose and SiTerminate or kill your thread or your thread won't return from the wait.

In addition to this code, I think you also need to install the 3DxWare SDK and the driver from our website. All of these pieces are free from any licensing obligations.

HelloSpacemouse3DxWare.zip is a version of the Java3D HelloSpacemouse program from the net that uses the 3DxWare driver instead of going to the serial port. The changes are limited to the pollAndProcessInput method of the SpacemouseDevice class. If you use this method, you will be able to support any 3Dx device that the driver supports, but, of course, you are limited to Windows.

If you use this and make changes, or create examples, that might help others, please post your changes.

Have fun!

Jim
3Dx Software Development
The ftp link seems to be broken. Is there another place where JNIsiapp.zip can be downloaded? I'd like to try to add Spacemouse support to a Java application.
Tehrasha
Posts: 187
Joined: Thu Apr 22, 2010 3:55 pm
Location: Iowa
Contact:

Re: Java-based development for the SpaceBall 5000

Post by Tehrasha »

This thread and that link is over 10yrs old.

Have you signed up to get the SDK? http://www.3dconnexion.com/service/soft ... loper.html
Spacemice -- Input devices for a 3D world.
Post Reply