First of all, this awesome new extension comes from the one and only…
Here it is in Zock’s words…
Awhile ago, a friend of mine lent me an Oculus rift. It is a virtual reality headset that can be use for immersive gaming. This is how it works: It tracks your head movement and alters the screen view inside the headset to match the way you are looking. This is cool, but I really wanted to use it in smallbasic, so I went ahead and wrote the OculusSB extension. What is does is return for you the yaw, roll and pitch for the Oculus rift. I have already used it in all sorts of smallbasic applications, and it works great! One of my favorites so far is using it with Litdevs 3d extension. Its pretty cool. Another thing I have done with it is hook it up to a webcam on a servo, and then control the servo with Litdevs waveform extention, so it will match the Oculus’ movements.
What I hope to end up accomplishing is using the oculus to control a camera on a RC aircraft, so it will really feel like you are on top of the airplane.
The Oculus has two eyepieces, which means you can give the illusion of depth if you make two duplicate objects (one in each eyepiece) and move them closer together and farther apart.
Here is a picture of what the Oculus looks like from the screens point of view:
So by moving the objects closer together, you make your self go further cross-eyed, telling your brain that the object is closer to you. It creates an amazing illusion.
Here is a quick program I wrote that works beautifully with the Oculus.
KRH756
The faster moving balls are closer together, which gives the illusion that they are closer to you.
I figured that other people might want to make use of it, so I’m going to post the extension here:
Here is how to use it. First, use OculusSB.PollRift() to update the Yaw, Roll, and Pitch functions. Then you can call OculusSB.GetYaw() (or roll or whatever) to get the desired sensor data.
Thanks guys, and have fun!
BONUS EXTENSION: Maestro Servo Controller
Hey guys! I just got a maestro servo control board and hooked it up to the Oculus with Smallbasic! It works really well!
The control board:
If anyone wants the extension to control the servo board from SB, you can download it here:
=====================
Thank you to Zock for these amazing extensions!
And remember to stay Small and Basic. The world is complicated enough as it is!
– Ninja Ed