C# – XBox 360 Controller library with a sample application

Created an easy to use XBox 360 Controller library in C# (with a sample application) using the SharpDX.XInput managed .NET wrapper of the DirectX API.

 https://github.com/okmer/XBoxController

Screenshot of the sample application.
Screenshot of the sample application.

A BUG in SharpDX.XInput ci-ci217, resulting in issues with the  left Thumb Stick, Left Trigger, and Right Trigger! Please stick to SharpDX.XInput v4.1.0-ci184 for now.

using System;
 
using Com.Okmer.GameController;
 
namespace XBoxSampleConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            XBoxController controller = new XBoxController();
 
            Console.WriteLine("XBox 360 Controller (Press ENTER to exit...)");
 
            //Connection
            controller.Connection.ValueChanged += (s, e) => Console.WriteLine($"Connection state: {e.Value}");
 
            //Battery
            controller.Battery.ValueChanged += (s, e) => Console.WriteLine($"Battery level: {e.Value}");
 
            //Buttons A, B, X, Y
            controller.A.ValueChanged += (s, e) => Console.WriteLine($"A state: {e.Value}");
            controller.B.ValueChanged += (s, e) => Console.WriteLine($"B state: {e.Value}");
            controller.X.ValueChanged += (s, e) => Console.WriteLine($"X state: {e.Value}");
            controller.Y.ValueChanged += (s, e) => Console.WriteLine($"Y state: {e.Value}");
 
            //Buttons Start, Back
            controller.Start.ValueChanged += (s, e) => Console.WriteLine($"Start state: {e.Value}");
            controller.Back.ValueChanged += (s, e) => Console.WriteLine($"Back state: {e.Value}");
 
            //Buttons D-Pad Up, Down, Left, Right
            controller.Up.ValueChanged += (s, e) => Console.WriteLine($"Up state: {e.Value}");
            controller.Down.ValueChanged += (s, e) => Console.WriteLine($"Down state: {e.Value}");
            controller.Left.ValueChanged += (s, e) => Console.WriteLine($"Left state: {e.Value}");
            controller.Right.ValueChanged += (s, e) => Console.WriteLine($"Right state: {e.Value}");
 
            //Buttons Shoulder Left, Right
            controller.LeftShoulder.ValueChanged += (s, e) => Console.WriteLine($"Left shoulder state: {e.Value}");
            controller.RightShoulder.ValueChanged += (s, e) => Console.WriteLine($"Right shoulder state: {e.Value}");
 
            //Buttons Thumb Left, Right
            controller.LeftThumbclick.ValueChanged += (s, e) => Console.WriteLine($"Left thumb state: {e.Value}");
            controller.RightThumbclick.ValueChanged += (s, e) => Console.WriteLine($"Right thumb state: {e.Value}");
 
            //Trigger Position Left, Right 
            controller.LeftTrigger.ValueChanged += (s, e) => Console.WriteLine($"Left trigger position: {e.Value}");
            controller.RightTrigger.ValueChanged += (s, e) => Console.WriteLine($"Right trigger position: {e.Value}");
 
            //Thumb Positions Left, Right
            controller.LeftThumbstick.ValueChanged += (s, e) => Console.WriteLine($"Left thumb X: {e.Value.X}, Y: {e.Value.Y}");
            controller.RightThumbstick.ValueChanged += (s, e) => Console.WriteLine($"Right thumb X: {e.Value.X}, Y: {e.Value.Y}");
 
            //Rumble Left, Right
            controller.LeftRumble.ValueChanged += (s, e) => Console.WriteLine($"Left rumble speed: {e.Value}");
            controller.RightRumble.ValueChanged += (s, e) => Console.WriteLine($"Right rumble speed: {e.Value}");
 
            //Rumble 0.25f speed for 500 milliseconds when the A or B button is pushed
            controller.A.ValueChanged += (s, e) => controller.LeftRumble.Rumble(0.25f, 500);
            controller.B.ValueChanged += (s, e) => controller.RightRumble.Rumble(0.25f, 500);
 
            //Rumble at 1.0f speed for 1000 milliseconds when the X or Y button is pushed
            controller.X.ValueChanged += (s, e) => controller.LeftRumble.Rumble(1.0f, 1000);
            controller.Y.ValueChanged += (s, e) => controller.RightRumble.Rumble(1.0f, 1000);
 
            //Rumble at the speed of the trigger position
            controller.LeftTrigger.ValueChanged += (s, e) => controller.LeftRumble.Rumble(e.Value);
            controller.RightTrigger.ValueChanged += (s, e) => controller.RightRumble.Rumble(e.Value);
 
            //Wait on ENTER to exit...
            Console.ReadLine();
        }
    }
}

Allseas – Innovation opens beers

Toying with an industrial robot at the office 😉

R&D Eindhoven (a.k.a. Inspection & Robotics) opens the Friday “borrel” beers with their new Fanuc M-710iC/45M Robot in combination with a Cognex In-Sight 2000 Vision Sensor.

R&D Eindhoven is part of the Innovation Department of Allseas Engineering B.V.

Around the world in 90 days

Traveling around the world in 90 days with my pregnant wife 🙂 See you later alligator!

AMS-LHR, LHR-YVR, YVR-LAX, LAX-HNL, HNL-NRT, NRT-TPE, TPE-HKG, HKG-PNH, REP-KUL, KUL-SYD, SYD-CNS, ASP-CNS, CNS-HKG, HKG-AMS
AMS-LHR, LHR-YVR, YVR-LAX, LAX-HNL, HNL-NRT, NRT-TPE, TPE-HKG, HKG-PNH, REP-KUL, KUL-SYD, SYD-CNS, ASP-CNS, CNS-HKG, HKG-AMS

Canada, Hawaii, Japan, Taiwan, Cambodia, Malaysia, and Australia…

AMS LHR 258° (W) 256° (W) 371 km
LHR YVR 324° (NW) 324° (NW) 7,601 km
YVR LAX 165° (S) 149° (SE) 1,739 km
LAX HNL 261° (W) 249° (W) 4,113 km
HNL NRT 299° (NW) 290° (W) 6,146 km
NRT TPE 242° (SW) 250° (W) 2,182 km
TPE HKG 249° (W) 254° (W) 807 km
HKG PNH 220° (SW) 223° (SW) 1,533 km
REP KUL 191° (S) 192° (S) 1,202 km
KUL SYD 133° (SE) 133° (SE) 6,579 km
SYD CNS 343° (N) 330° (NW) 1,966 km
ASP CNS 060° (NE) 056° (NE) 1,454 km
CNS HKG 320° (NW) 314° (NW) 5,553 km
HKG AMS 324° (NW) 327° (NW) 9,290 km

Total: 50,537 km

Duck Hunt VR (for the HTC Vive)

My first little Unity 3D Virtual Reality project, inspired by my old friend the Nintendo Entertainment System. Please keep in mind the I have never used Unity 3D before, so this is my first sandbox application…

Download link to DuckHuntVR Alpha 04: http://tinyurl.com/hb3u42x

This Alpha 04 release incorporated a lot of used feedback from the Vive subreddit: https://www.reddit.com/r/Vive/

In particular the feedback gathered during this live coding session: https://www.reddit.com/r/Vive/comments/4pbx4x/duck_hunt_vr_for_the_htc_vive_alpha_03_this_is_a/

DuckHuntVR game scene
DuckHuntVR game scene
Duck Red
Duck Red
Duck Green
Duck Green
Duck Blue
Duck Blue
Triple duck dog
Triple duck dog
Zapper EU version.
Zapper EU version.
Zapper US version.
Zapper US version.

Campus Party Europe in The Netherlands

Elske and I spend two full days and one night at the Campus Party in the Jaarbeurs Utrecht. I was invited on stage to give a little talk about: How to start with Virtual Reality game development []-)

Overview of the stage and work area.
Me doing an unofficial talk about starting with virtual reality game development.
2000 tents, a little refugees camp for nerds.