Headtracking With Normal Webcams

Using OpenTrack and AITrack

Gaming How-To Tech

4 minutes

Originally posted on Reddit.

Now that SWSquadrons supports TrackIR, this opens up the potential to play the game using various 3rd party software alternatives to the expensive TrackIR hardware. We’ve seen one solution so far that involves pairing a paid smartphone app with OpenTrack (one of these free open source headtracking solutions), but if you already have a webcam, even one built into a laptop, you can use OpenTrack with a different piece of input software: AITrack, which is free to use.

Requirements: #

  1. OpenTrack headtracking software
  2. AITrack headtracking input
  3. Pretty much any webcam with at least 640x480 resolution and 30fps capture. Higher resolution doesn’t matter so much but more fps will make tracking smoother. PS3 Eyecam is a good cheap way to get 75fps right off the bat.

If you don’t have a webcam, you can use DroidCam to turn your Android phone into a webcam, or a capture card or Camlink to input your DSLR/camcorder to your PC.

Alternatively you can spend the $10 to use SmoothTrack, the software I referenced in the opening paragraph.

Installation #

  1. Download and install Visual C++ Redistributable x64 in case you don’t already have it.
  2. Download Opentrack from Opentrack’s releases page
  3. Download the most recent version of AITrack from the releases page (.zip file) and extract its content.
  4. Run Opentrack and make sure to select Input = UDP over network, then, click “Start”. Opentrack then will be for the data AITrack will send.
  5. Run AITrack.exe from AITrack and click “Start tracking”.
  6. Look around!

Video instructions are also available from the AITrack developer.

Configuration #

As with any software-based headtracking solution, some configuration will be required in order to tune the tracking to exactly your webcam placement and room conditions. Just how much configuration is necessary depends on your specific setup and pickiness, but here’s some of the key options as well as comments on what worked for me:

  1. First, familiarize yourself with the software. There is already an excellent guide to configuring OpenTrack on the IL-2S forums written by Francisco Bindraban. I suggest reading it through, but for the purposes of just setting this up for SWSquadrons, you can focus on these sections:
  • Setting up your Opentrack > Options > Output
  • Setting up your Opentrack > Options > Mapping
  • How do you set your “curves”?

You will not need to worry about any other section of the guide or the OpenTrack software for the purposes of this game, but it helps to know the fundamentals of headtracking just so you’re aware of how it works and what you need to do in case troubleshooting is necessary.

  1. Set up your curves. The best way to do this is to have Squadrons open in borderless windowed mode, go into the hangar, and have OpenTrack open on top of it with the curve editor up. That way, you can adjust the curves and look at the effect in game in real time, as the hangar accepts headtracking input. Below is an excerpt from Bindraban’s guide on the importance of curves:

Curves #

When dealing with head-tracking, a glaringly obvious problem will present itself. To look towards the sides, backwards, and up or down, you need to turn your head. However, your monitor does not move with you when moving your head. This means that when you look back, you can’t see your monitor anymore. To solve this problem, a multiplier is used. For instance, when you move your head 5 degrees right, the game will move your head 30 degrees right in-game.

These multipliers can be tweaked to your liking. You might like a dead zone in the middle; a zone where your small movement will lead to no movement in-game at all (useful for looking down the sights).

The great advantage of these multipliers is that they can be tweaked to get different effects. For instance, if I want small movement when looking forward but large movement when looking back, then you can use curves. These curves are fully adjustable and should be set to your liking.

Keep in mind that it will take a little bit of time to get used to these curves. However, you get used to them quite quickly and then you won’t even notice it is there. It will feel natural.

Enjoy #

All of this seems like a lot to take in, but these are just over-explained steps to a relatively straightforward setup. In all actuality it took me less than 10 minutes to get this all going, and this is coming from no prior experience with OpenTrack and AITrack at all (though I do have experience using a different head tracking software, FaceTrackNoIR, which for whatever reason isn’t working in Squadrons—hence the switch).

Of course, this isn’t a perfect replacement for hardware-based headtracking, and nowhere near the immersiveness of VR. But it is an easy and free way to get started on that path, as well as a good way to take advantage of everything you might already have in order to experience a feature in this game, and probably others that you already own as well.

Comments: