Space Mouse Enterprise

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

Post Reply
GKA
Posts: 5
Joined: Thu Jun 18, 2020 7:44 am

Space Mouse Enterprise

Post by GKA »

Dear all,

for years I used a Space Pilot Pro for my self made scientific application for microscopy (meanwhile 650 000 lines of code done in 15 years of work durin my sparetime). The "good old" Space Pilot Pro worked well and yet does its job. Meanwhile I even got rid of the annoying Logitech logo and replaced it through my own one.

BUT:
What I really really miss is a modern interface on the mouse which alters its functionality due to the current modus the application runs. I felt in love with the Space Mouse Enterprise, therefore :-) because it seems I could realize this wish with that nice piece of hardware (hopefully).

Do you think following job could be done with the Space Mouse Enterprise?

a) Application is in modus A and throws (during runtime) 12 Shortcuts (and 12 icon bitmaps) to the Space Mouse Enterprise.
The display of the mouse shows those 12 Icons and the user may select the corresponding buttons on the mouse to execute the commands within my self written application

b) Application switches to another mode B and throws another (different) 12 Shortcuts (and therefore 12 other icon bitmaps) to the display of the mouse replacing functionality A of the application. When the user pushes one of the 12 buttons on the mouse now, the new command is executed.

c) The Application switches back and forth A & B mode due to users demands on current task to be done.

If that programmatically induced replacement of icons/shortcut functionality during runtime of the application is possible I'd be very VERY happy and I will instantly place the order for my brand new Space Mouse Enterprise :-)

Please allow me another question concerning your SDK. How do I get the information of the sensor and the buttons within my C# written Application? Is that done with callbacks (as I did it in former times when I programmed the SpacePilot Pro)?
I am a little bit confused with the "Model" stuff shown in the sample code. Isn't it all available through callbacks (sensor values, button events) and interfaces (to send the icons/shortcuts)?

If it is more complicated than expected, is there a kind of "Wiki" available? I really have my problems with the provided sample sourcecode as I do not see my beloved callback and interface functions, but a lot of RibbonModel stuff instead.

I apologize in advance, if my questions appear to be silly.

Kind regards and thanks for reading this looooooooooooooooong text :-)
Happy programming!
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Space Mouse Enterprise

Post by jwick »

Hello,

Yes, the driver can do what you want. It is, in fact, the recommended procedure.

Using the SDK, your application can give the driver a tree of your application's commands (with icons). These will be displayed in our GUI and the currently assigned commands (and icons) will be displayed on the SME's LCD.
You can define any number of modes in your application, and switch modes at any time. The button assignments are saved per mode, so they are all restored when you switch from mode to mode.

I assume your previous code was using our TDxInput assembly. That's quite old. I don't think we had support for these command trees (and icons) at that time.

Our new SDK (4.0) takes a different approach. It expects to trade view matrices with you. You give it your view matrix, it takes care of reading the device input, and it gives you back a new view matrix. This is done through callbacks. This may or may not work for you. We can discuss alternatives if need be.
GKA
Posts: 5
Joined: Thu Jun 18, 2020 7:44 am

Re: Space Mouse Enterprise

Post by GKA »

Hi there
today my newly ordered Spacemouse Enterprise arrived. Nice thing!

After downloading the newest driver and SDK, I tried to understand how to feed an own Menu and receive the sensor data (X;Y;Z;Rotation) from the device as I'd like to use that mouse with my own written (scientific) application.

Of course I studied the sample source code, but I did not succeed in even getting an object loaded (using the most left "load" button) into that sample app. After I tried the samples 3DxHouse.obj, Turbine4.obj (within the SDK/models directory) I got the Exception "TDx.SpaceMouse.Navigation3D.NoDataException: 'This camera does not have a target'"

Ok, I generated an object using Blender, attached the camera to the main object and did an export to give your sample app a shot. Same exception! Same exception message!

Hmmmm.

Does your sample application load any own button functionality to the space mouse? I do not see any on the SpaceMouse screen, after your sample application launched.

I'd be very happy if you could provide me with some sample sourcecode in C# which could help me to continue programming an interface for that nice SpaceMouse, so that I could use it with my own written application.

1. How to receive the sensor movings (X, Y, Z, Rotation)
2. How to feed my own button functionality to the space mouse display
3. How to receive (callbacks?) which button (of the 12 below the display) is pressed.

Thank you sooooooooooo much for your patience and your help.

Kind regards
Gerhard
mbonk
Moderator
Moderator
Posts: 181
Joined: Mon Dec 04, 2006 4:06 am

Re: Space Mouse Enterprise

Post by mbonk »

Hi Gerhard,
...I got the Exception "TDx.SpaceMouse.Navigation3D.NoDataException: 'This camera does not have a target'"
The 3DxTestNL sample throws TDx.SpaceMouse.Navigation3D.NoDataException when the navigation library queries queries a value that does not exist. When debugging with visual studio a message is displayed in the Output window, or if 'Common Language Runtime Exceptions' in the 'Exception Settings' tab is checked, an 'Exception Thrown' dialog is displayed, otherwise when 3DxTestNL is started by double clicking the executable no exception message is displayed.

In the 3DxTestNL sample the camera does not have a target: it is a free camera. See here for an explanation of what a camera target is. For example, in 3ds Max a camera with a target is called a Target Camera, Unreal and Unity name the camera an 'Orbit Camera'.
Does your sample application load any own button functionality to the space mouse?
The method TDx.TestNL.MainExecutor.ExportApplicationCommands exports the command set for the application's toolbar.
The event handler TDx.TestNL.MainExecutor.ExecuteCommandHandler executes the commands i.e. handles the TDx.TestNL.Navigation.NavigationModel.ExecuteCommand event.

The commands are assignable to SpaceMouse buttons in the 'Buttons' panel of the '3Dconnexion Properties' for the 3DxTestNL application.
how to [...] receive the sensor data (X;Y;Z;Rotation)
The simple answer is: not with this SDK. The whole point of the SDK is to remove the burden of doing all the navigation maths from the integrators: the application just needs to implement a predefined interface and in turn gets all the navigation modes, algorithms and features delivered in the navigation library for free. What the SDK is asking the C# developer, in this case, to do, is to code the class NavigationModel for the target application by implementing the TDx.SpaceMouse.Navigation3D.INavigation3D interface.

Markus
Post Reply