Rotation Not Proportional from SDK under .Net?

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
rpltn
Posts: 5
Joined: Mon Sep 14, 2015 4:42 pm

Rotation Not Proportional from SDK under .Net?

Post by rpltn » Sat Nov 07, 2015 2:16 pm

Is the TDxInput.Device's .Sensor.Rotation property -1, 0, 1 for any rotation axis by design? The .Sensor.Translation property is proportional and works fine, but rotation is "digital", unlike the demo applications (I am using both in the same way). What am I missing here? Using TDxInput 1.0, .Net application.

ngomes
Moderator
Moderator
Posts: 1944
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: Rotation Not Proportional from SDK under .Net?

Post by ngomes » Mon Nov 09, 2015 2:18 am

Hi rpltn,

Regardless of the interface used to get 3D mouse data, rotation values shouldn't be only between -1 and 1.

Do you see this with any SDK sample or just your program? What version of 3DxWare 10 do you have installed?
Nuno Gomes

rpltn
Posts: 5
Joined: Mon Sep 14, 2015 4:42 pm

Re: Rotation Not Proportional from SDK under .Net?

Post by rpltn » Tue Nov 10, 2015 12:48 am

Hello ngomes,

I am running 3Dconnexion 3DxWare 10 (32 bit) 10.1.4, Revision 1818.

The SDK samples all appear to have been written in C++, and TDxInput is not used in these samples after a quick look... I am thinking there is a perhaps a problem with TDxInput? I have checked the revision history and see no information regarding a correction to TDxInput since 10.1.4 ...

Here's a VB.Net example to illustrate what I'm seeing, after adding a Reference to TDxInput:

Code: Select all

Public Class Form1
    Private TDx As New TDxInput.Device

    Sub New()
        InitializeComponent()
        AddHandler System.Windows.Forms.Application.Idle, AddressOf AppIdle
    End Sub

    Private Sub DxTesting2_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
        TDx.Connect()
    End Sub

    Private Sub AppIdle(ByVal sender As Object, ByVal e As EventArgs)
        Dim wMsg As NativeMethods.Message

        While Not NativeMethods.PeekMessage(wMsg, IntPtr.Zero, 0, 0, 0)
            Debug.Print("RotX: " & TDx.Sensor.Rotation.X & " RotY: " & TDx.Sensor.Rotation.Y & " RotZ: " & TDx.Sensor.Rotation.Z & _
                         " TrX: " & TDx.Sensor.Translation.X & " TrY: " & TDx.Sensor.Translation.Y & " TrZ: " & TDx.Sensor.Translation.Z)
        End While

    End Sub

End Class
And what I get as output from this code:

Idle, without touching the knob:
RotX: 0 RotY: 0 RotZ: 0 TrX: 0 TrY: 0 TrZ: 0

Pushing the knob Forward:
RotX: -1 RotY: 0 RotZ: 0 TrX: 0 TrY: 0 TrZ: -64

Pushing knob Right:
RotX: 0 RotY: 0 RotZ: -1 TrX: 29 TrY: 0 TrZ: 0

Twisting knob Clockwise:
RotX: 0 RotY: -1 RotZ: 0 TrX: 0 TrY: 0 TrZ: 0

I see no proportional values for Rotation values, unless multiple axis are involved...

Pushing knob towards North-West position:

RotX: 0.748078131335318 RotY: 0.0029418802917681 RotZ: -0.663604140100262 TrX: 411 TrY: 282 TrZ: 502

Translation performs as expected, Rotation is not working as one would expect!!

Thanks!!

ngomes
Moderator
Moderator
Posts: 1944
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: Rotation Not Proportional from SDK under .Net?

Post by ngomes » Tue Nov 10, 2015 1:25 pm

Hi rpltn,
I am running 3Dconnexion 3DxWare 10 (32 bit) 10.1.4, Revision 1818.
When you can, please upgrade to the latest available version (available from here).
The SDK samples all appear to have been written in C++, and TDxInput is not used in these samples after a quick look... I am thinking there is a perhaps a problem with TDxInput?
3DxInput (TDxInput.dll) has been deprecated since a while. Having said that, it should still work fine with recent builds of the driver included in 3DxWare 10.

As you are starting to develop 3D support in a managed code program, I suggest that you get in touch with the API Support team (contact e-mail available from the SDK web page) and request assistance with using the official SDK driver API in a C# program.

Post Reply