SiS-Shadowman / RiftDotNet

MIT License
32 stars 12 forks source link

Orientation not tracking Y axis #1

Open Robmaister opened 11 years ago

Robmaister commented 11 years ago

I needed to get some more information about the Rift, so I switched to RiftDotNet from RiftSharp.

I'm just experiencing one (major) issue with this switch. The orientation from RiftDotNet does not track rotation on the Y axis (no ability to look left/right)

Code:

static HMDManager hmdMgr = new HMDManager();
IHMD hmd;

protected override void Initialize()
{
    //other stuff

    hmd = hmdMgr.AttachedDevice;
    hmd.Reset();
}

protected override void Draw(GameTime gameTime)
{
    //other stuff

    //RiftSharp.Quaternion quat = RiftSharp.Hmd.Instance.Quaternion;
    SharpDX.Quaternion quat = hmd.Orientation;
    cam.Rotation = new Quaternion(quat.X, quat.Y, quat.Z, quat.W);

    //other stuff
}

Commenting out the RiftDotNet stuff and uncommenting the RiftSharp line creates a quaternion that perfectly represents the Rift's orientation, while the RiftDotNet stuff does not rotate along the Y axis, though I can get it to rotate along that axis via the drift created by the other two axes. Why?

Dragoneric commented 10 years ago

I've a similar Problem. The X-Value (Pitch) from the orientation is okay. TheY- Value (Yaw) is absolute unusable Values. Has anybody an Idea what the problem is? I read the parameters as the same way, but the yaw is sometimes positive sometimes negative and sometimes it is counting up like a stopwatch. And the best, this all by the same position and movements... Has anybody an idea to solve this, or does anybody know an alternative for this C# Wrapper?

Borstenhorst commented 10 years ago

You might try: https://github.com/davyloots/riftsharp Less features but works.

Dragoneric commented 10 years ago

Thanks for the fast support. I found it, but i doesn't know how can i use it. I refer the RiftSharp.dll from the RiftSharp directory and all is fine. but how can i get the values? I use for testing simple textboxes like

Pitch.Text = (RiftSharp.Hmd.Instance.YawPitchRoll.Pitch * (180 / Math.PI)).ToString(); Yaw.Text = (RiftSharp.Hmd.Instance.YawPitchRoll.Yaw * (180 / Math.PI)).ToString(); Roll.Text = (RiftSharp.Hmd.Instance.YawPitchRoll.Roll * (180 / Math.PI)).ToString();

but if i run this code, instance is null and i get an exception. The Hmd class has only a private Constructor for the singelton Pattern, but how can i initialise the whole stuff?

Borstenhorst commented 10 years ago

please post this issue in the RiftSharp project, not here.

Its a static class you do not need in instantiate it. Check the exception, if it is telling you that the .dll is missing check if you have the Microsoft Visual C++ (I think 2010) package installed.

Dragoneric commented 10 years ago

okay, thanks... i post it into the RiftSharp project.