How to Make Head Tracking Cameras in Nintendo Labo VR Kit Recipe for Head Tracking; Nintendo Labo VR Kit with Toy-Con Garage VR unlocked, Nintendo Switch, Joy-Con R with DIY stand, and the Toy-Con Snorkel or 6 reflective stickers in the same pattern. Understanding the Snorkel: The Snorkel’s position and rotation is tracked using the Infrared Camera inside the Joy-Con R. Use an IR Marker node to see the data the camera sees. The Funny-Face Snorkel game in the VR Plaza is a good place to start learning how it works. Open the Sample and find the Toy-Con in the lower left. Find the 6 Map nodes attached to the Snorkel Position & Angle nodes. Notice the Output Range numbers, which tell the Snorkel how far to move and rotate. The Scary-Face Snorkel game tracks the Z position differently for a surprising effect. Feel free to experiment. There’s lots to discover. How to Make the Snorkel Here’s an overview of the basic Snorkel setup we’ll be making. Start by placing a Sphere in front of the player and move it 1 meter above the ground. This is the reference point that the Snorkel moves around, AKA the root.
Set the Sphere to Visible and disable the rest of the options. This Sphere should not be Movable, otherwise it would be thrown when the Snorkel moves. To make the Snorkel move, add 3 Snorkel Position nodes and set them to X, Y, and Z. Give each one a Map node. Set the Output Ranges to -4 and 4, a smaller area than the Funny-Face Snorkel game. You can set the first Map node and make copies. Connect the Map nodes to a Free Slide Connector. Make sure to match X, Y, and Z correctly. Then connect the Free Slide Connector to the root Sphere. Add a Sphere to the Free Slide Connector. FYI, connecting two Connectors requires an Object between them. Set the Sphere to Visible, Movable, and Blue. Check Connection Points on Objects, they are set to Automatic by default. Set them all to ●▶●, so they’ll be connected at the center. Time to test the Snorkel position. Notice how the Snorkel moves relative to the root. To make the Snorkel rotate, add 3 Snorkel Angle nodes and set them to X, Y, and Z.
Give each one a Map node. The Output Range should match the Funny-Face Snorkel, since it is the actual rotation of the Snorkel. Set it to -.5 and .5 Make 3 Hinge Connectors and set them to X, Y, and Z. Connect them to the matching Map nodes. Add Spheres between each of the Hinge Connectors and set them to Movable only. Also set the Connection Points to ●▶● Add one more Sphere to the end and set it to Visible and Movable. This will be the Object that moves and rotates as the Snorkel is tracked. Disable the Visibility on the previous Spheres, so we only see the Object on the end.
Finally, connect the Z rotation Hinge Connector to the position Sphere, and we have a complete Snorkel! This is a good time to check your Connection Points, since they are set to Automatic by default. Set all Connection Points to ●▶● The Snorkel code assumes the Switch and Joy-Con R are inside the Toy-Con Camera. So the IR camera should face away from the back of the Switch. How to Make a Head Tracking Camera This is an overview of the Head Tracking Camera setup.
We’ll start by editing a copy of the Snorkel we just made. Make a copy of the Snorkel File and give it a name, so we have a starting point for the Head Tracking Camera. This way the Snorkel can be used again later. Since we’re using the Snorkel and Joy-Con R in reverse, the root Sphere must be rotated 180 on the Y axis. Or else the Camera will face backwards later. Attach a Camera Position node to the last Sphere, and set the Connection Point to ●▶●. Make the last Sphere not Visible since it is blocking the camera. Add a Camera Target node to the same Sphere. Set the Connection Point to Z+▶Z- so it will be in front of the Camera Position, since we rotated the root 180.
When using Camera Position, Snorkel Angle Z is ignored. Since the camera won’t tilt on Z, the Z Angle nodes can be removed. Then just reconnect the Y Hinge. Create a stand for the Joy-Con R and angle it so the camera has a good view of the Snorkel as you move your head around in front of the Switch. Now that you’re using the IR Camera to track the player, check out the Discover menu and play through the Camera section to learn how the IR Camera works. How to Make a Tablet Tracking Camera This is an overview of the Tablet Tracking Camera setup. This time we’ll start by editing a copy of the Head Tracking Camera we just made.
Looks easier, right? Make a copy of the Head Tracking Camera File and name it, so we have a starting point for the Tablet Tracking Camera. Keep the previous File for later. The Switch tablet automatically tracks its rotation using the gyroscope. So remove the Snorkel Angles, their Maps, Hinges, Spheres, and the Camera Target. Connect the Camera Position to the last sphere, and we’re done programming! Attach the Snorkel to the back of the Switch tablet. You can also attach reflective stickers directly to the Switch, but don’t forget the Snorkel tube. Notice how the horizon tilts with the Tablet Tracking Camera, unlike the previous example that uses Snorkel Angle nodes. Now that you‘re familiar with Head Tracking Cameras, you can make one in your own games or modify one of the VR Plaza games.
You can make the root Sphere Movable and connect it to a moving Object. This tank doesn't have a Z Snorkel Position node so the rider stays in the seat. What can you make with head tracking in Nintendo Labo?.