Peters, my obese Dutch lodger, squeezed himself out of the sofa and kicked over the TV set.
‘What the hell are you doing!’ I screamed at him, whilst lifting the flat screen up through billowing smoke to expose a huge crack.
‘Fuckin lost at the lottery again,’ he moaned.
I told him that he would need to buy a new TV for the house. ‘Now I have nothing to watch Countryfile on,’ I lamented.
In a jam, there is sometimes a drip or two of fruity inspiration. I will build a TV for my Oculus Rift virtual reality headset!
I followed the first few minutes or so of VscorpianC’s tutorial on how to build a flat screen TV in Blender.
My flat screen TV is looking pretty nifty:
Sri Harsha Chilakapati’s tutorial on adding textures in Blender helped me get a default image on the TV screen:
Superb. Now, let’s start by broadcasting the images captured from my webcam onto the TV set. I have already done something similar with a cube in my post Oculus Rift: watching you watching me.
To recap, I import my Blender TV model into a C++ Visual Studio application using Assimp (and SOIL to load the default image for the TV screen). Once imported, I can use the Oculus SDK for Windows and OpenGL to render the TV set meshes into a virtual world. OpenCV then grabs a stream of images from my webcam and puts them on the TV screen, replacing the default image.
Here’s the virtual world with a rather large flat screen TV sitting on the floor:
Fantastic! The TV is broadcasting a stream of pictures from my webcam. The webcam has captured my hand holding an Oculus Touch controller (which is controlling the virtual hand you can see below the TV set).
‘Can I have a peek at your virtual reality TV set,’ Peters asked, reaching for my Oculus Rift headset.
‘No you fuckin can not,’ I barked, ‘Get yourself down Currys and buy a new Sony TV for the one you smashed with your boot.’
Peters waddled off.
All I need do now is stream Countryfile onto my virtual TV, and the yin and yang of my soul will be in perfect harmony.