c# example and loss of resolution on Rotations

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

Moderator: Moderators

Post Reply
daddda
Posts: 4
Joined: Thu Oct 16, 2008 7:38 pm

c# example and loss of resolution on Rotations

Post by daddda »

I've used the C# example code to great success except for the fact that rotations only produce the value 1 or -1, nothing in between for greater control. Translations work great.

Here's my initialization...

Code: Select all

this.mDevice3DX = new TDxInput.Device();

            this.mKeyboard3DX = mDevice3DX.Keyboard;
            this.mSensor3DX = mDevice3DX.Sensor;

            this.mKeyboard3DX.KeyDown += new TDxInput._IKeyboardEvents_KeyDownEventHandler(keyboard_KeyDown);
            this.mSensor3DX.SensorInput += new TDxInput._ISensorEvents_SensorInputEventHandler(sensor_SensorInput);
            this.mDevice3DX.Connect();
as well as..

Code: Select all

void sensor_SensorInput()
        {

            camLR  = (float)mSensor3DX.Translation.X / -10;
            camFB  = (float)mSensor3DX.Translation.Y / 10;
            lookLR = (float)mSensor3DX.Rotation.Z    / -10;
            lookUD = (float)mSensor3DX.Rotation.X    / -10;
.
.
.
.
The -10 values are only to slow stuff down.

any ideas?
ngomes
Moderator
Moderator
Posts: 3344
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: c# example and loss of resolution on Rotations

Post by ngomes »

Hi daddda,
any ideas?
Rotation data is provided by a unit vector and an angle around it (the "axis-angle" rotation convention). This is one several standard conventions (Euler angles, rotation matrices are others). Unit vectors have components between -1 and 1. You can find an explanation of the data format in the 3DxInput doc.

You may also refer to this topic.
Nuno Gomes
daddda
Posts: 4
Joined: Thu Oct 16, 2008 7:38 pm

okay, gotcha

Post by daddda »

But given my lack of knowledge and experience with Euler and Matrices, is there any code I can use, already written, that can give me the fine rotations I need? I wish I could come to this forum with more experience, but I don't, sorry.
daddda
Posts: 4
Joined: Thu Oct 16, 2008 7:38 pm

Opps never mind

Post by daddda »

I found a pretty good example on the FTP site

login examples
password examples
directory examples

Thanks for inspiring me to look around.
Post Reply