How to make homemade virtual reality glasses. How to make virtual reality glasses

There are practically no people left who have not heard about virtual reality, and probably everyone has already heard about the Oculus Rift VR helmet, which can be said to have become the standard for this kind devices. There are also solutions on the market that allow you to use a 4-5" smartphone screen as a screen for VR glasses, such as Durovis Dive or the sensational Google Cardboard, which have lowered the bar for democracy in entering virtual reality, one might say for everyone, but still However, this technology has not yet become ubiquitous: not everyone has a smartphone with the required diagonal to use the same cardboard project of Google, buy a device like Durovis Dive, albeit not expensive, but worth the money, without any understanding of what exactly to do with it next , and even more so, ordering and waiting for the Oculus Rift helmet itself is quite problematic for the average person for many reasons - starting from the price of the device, what to do with which is not yet entirely clear, and ending with a rather long wait for the delivery of the order. Naturally, the most important obstacle, besides the price, is. is ordinary laziness and extinguished curiosity.

In this article I will tell you about my path to virtual reality, I will describe in detail and practically comprehensive guide to make a VR helmet using any relatively modern Android smartphone or tablet of any diagonal, this project will cost approximately 5-8 hours of work and 500-2000 rubles in costs, depending on your wishes and capabilities, and at the end you will get very An interesting device that will allow you to watch fullHD 3D movies and photos, play Android games, and also use a helmet to play your favorite PC games of any level of modernity. Yes, with head tracking and VR immersion.

Therefore, if you are not overwhelmed by laziness and are inquisitive, I ask for the cut, but I warn you, the article is filled with three dozen “potato quality” images, with a total weight of 4 megabytes.

Attention, use everything described below at your own peril and risk; errors in manufacturing may result in a spasm of accommodation and fatigue during prolonged use.

In a recent article about Google Cardboard readers admired such a simple and interesting concept - a helmet made of cardboard with a pair of lenses, insert your smartphone and fly, but many had questions “how to make it for a different diagonal”, “how to install a tablet there”, and, most importantly, “why do I feel bad” you can see this 3D of yours.” Me, as the owner of a 6.4" smartphone Sony Xperia Z Ultra also became interested in these questions, especially after my friend received a parcel with the newly released Durovis Dive, where, as in cardboard helmet Google, you can only mount the devices around five inches diagonally, and he gave me a pair of lenses that he bought to make his own helmet.

An attempt to lean my smartphone against the Durovis dive was unsuccessful - something, of course, was visible, but it was far from 3D or even an acceptable picture, and there was no smell of virtual reality. At the same time, the fourth nexus installed in this device showed good results, but the resolution of 1280x720 pixels also did not allow us to fully experience immersion.

So, having a smartphone, a couple of lenses and some optimism in my hands, I decided to spend a little time making a VR helmet. If you already have a similar helmet, of your own design, Google Cardboard or Durovis Dive, and you are not interested in reading my manufacturing experience, you can go straight to the description of the application possibilities, I am sure it will be interesting to you.

Tools and materials, necessary equipment for making a helmet

So, the first thing we need is a fullHD smartphone or tablet with operating system Android, the more modern, the better, while the diagonal, for the most part, is not important. The most great value has the long side of the screen - it should not be much smaller than twice the distance between your pupils, but it should not be much larger either - the center of each half of the frame should fall in the center of the pupil, this parameter is adjusted by moving the lenses closer and further away from each other, and here there are pitfalls. For reference, the diagonal of the smartphone used in the described helmet is 162 mm, and the long side is 142 mm.

The second thing we need is lenses. Here you need to remember that the working area of ​​the lens with minimal distortion is in the center, and with distance from it, the image quality rapidly decreases, so the diameter of the lens must be large enough to cover without distortion the difference in distances between the eyes and the centers of the halves of the frame, but at this should not exceed a certain limit so that the lenses can be moved closer to each other or moved further apart, but so that the gaze passes close to the central area of ​​the lens. This is shown schematically in the figure below.

On the topic of choosing and searching for lenses, and in general optical system I will not go into detail, because it is problematic to fully describe this vast topic in this article; there are many options, and I don’t know which one you will have. In my case, a couple magnifying glasses were bought at a hardware store for 160 rubles, here they are:

During tests and initial adjustments, it was decided to disassemble their bodies, and what a surprise - in each such magnifying glass there turned out to be a pair of identical (in any case, indistinguishable to the naked eye) lenses with a diameter of 50 mm and a thickness of about 8-9 mm, and we will work with them.

Actually, to make a helmet you will need the following materials and tools from the nearest hardware store, in my case it was Leroy Merlin:

1. Construction foam, medium density, 20 mm thick - 0.5 m2, 60 rubles per sheet

2. Foamed polyethylene, 20 mm thick - 0.8 m2, 80 rubles per sheet

3. A roll of double-sided tape and a sheet of 2mm micro-corrugated cardboard - 60 rubles for everything

4. Wide elastic band or belt, possibly with Velcro - 50 rubles for everything

5. A set of tools for drawing and cutting materials - 100 rubles for everything

6. Scotch tape, or in my case, vinyl film in assortment - 100 rubles for everything

I’ll say right away that when buying materials I didn’t know the required consumption, but according to eyeball estimates, one sheet of foam and polyethylene purchased should have been enough for 3-4 such helmets, and all this was not sold in smaller volumes. It’s not a problem, before starting work, just remember the following useful skill - cut and cut exactly half of the material, don’t be afraid to throw it away and try again - the materials cost pennies, and your comfort inside the helmet is priceless, so it’s better to remake the part more conveniently than to endure it later rubbing surface or squeezing, or vice versa, too loose size of the resulting product.

Further, optimizing your activities, I will tell you in advance that even before starting work, you will need to download applications and files to your smartphone on which you will try and adjust your optical system.

Programs and files for testing functionality

So, you have downloaded and tried the methods described above, and have chosen the one most suitable for you personally. fast work. Let's agree that you have a smartphone or tablet with a 6-7" diagonal, two pairs of lenses (you can try with one pair, but my scheme is still two, discrepancies are possible, use at your discretion), installed programs and purchased materials from tools. The first step will be to make the first frame for the first pair of lenses. I made it from polystyrene foam, and in theory, it would be nice to have a centrifuge on hand, even for concrete, which is used to cut sockets, but in general, any type of sliding cutter for wood will do. or even a compass. I didn’t have any of this on hand, so I had to cut out the round holes with a Walter White stationery knife, which, with the diameter of the lenses being smaller than mine, would be completely untidy. So, the first blank is a frame for two lenses, as shown. picture below.

In order to make it, you will need to place the smartphone on the table with the screen up, lean over it, and picking up the lenses, bring them to your eyes, trying to find the focal length. You need to strive for the minimum distance between your face and the screen, so that it fits into the “lens” and the 3D effect is observed. If this effect is not observed, is shifted or distorted, do not despair; first, it will be enough to understand the focal length, or more precisely, the amount by which you need to remove the lenses from the smartphone. What about the distance between the lenses in this pair? It's simple - find the value that is halfway between the distance between the pupils and the distance between the centers of the halves of the frame (half the long side of the screen). Let's say we have 65 mm between our eyes, and the screen is 135 mm, half of it is 67.5 mm, which means you need to place the centers of the lenses at approximately 66 mm, for a first approximation this is enough.

Now, after we have marked the required distances, we cut out the holes for the lenses. Having approximately estimated the density of the foam, I considered that it was enough to firmly install the lens; if I made a hole for it with a diameter slightly smaller than the lens itself, I reduced the cut circle by 2 mm in diameter, which coincided perfectly with the assumption. Your parameters may be different, but the essence is the same - make the holes a little smaller. You need to recess the lens shallowly, I recessed it by 2 mm, below it will be clear why, and there is probably no need to mention that it would be nice to place the lenses in the same plane, that is, they should both be recessed evenly.

The first stage is completed, now we have a mock-up of the screen-to-lens distance, and we can move on. Remember what I said about two pairs of lenses? They may not be that important in an optical sense (they actually are), but they are invaluable for further tuning. Let's say you installed the first pair of lenses as described above, turned on a 3D image on your smartphone (game, movie, your choice), and are trying to find three-dimensionality. One pair of lenses did not allow me to do this at once. But when I brought the second pair to my eyes and, after playing with the distances, found the desired position, a three-dimensional image immediately appeared on the screen. To achieve this, you need to simultaneously move the lenses relative to the screen, in a plane parallel to this screen and the first pair of lenses, up and down and to the sides. Find a detail in the image that you can use to track the parallax effect, focus on it and try to connect the images in each eye so that they match. With some skill, this can be done very quickly, but, unfortunately, I cannot tell you a way to speed up this process. This test stand helped me, here the lower pair of lenses is already in foam plastic and adjusted to the screen, and the upper pair, framed in polyethylene, and each lens separately, I moved in front of my eyes, in search of “stereo”, and under the entire structure - screen at the desired height:

Sooner or later you will get fresh, juicy, fashionable youth 3D, but due to the introduction of a second optical pair into the circuit, the first focus setting will be a little off. There is no need to be scared, all that is required is to reconfigure the focus again. To do this, you first need to make a frame for the second pair of lenses you just adjusted. My advice is to first copy your first frame adjusted for the changed distance between the lenses, and then visually estimate the distance between the first and second pair of lenses after you have adjusted the three-dimensionality. It will be enough by eye, and this distance should be compared with the thickness of the material - well, literally, whether the distance between the pairs is greater or less than the thickness of the foam. If it’s less, everything is simple, you will need to install the lenses in the second frame a little deeper, by the required amount, but if this distance is greater than the thickness of the foam, you can simply turn the first frame over with the more recessed side facing you, so you don’t have to fence a garden made of spacers between two frames. In my case, this is what happened, I turned the first frame upside down, folded these frames with their more recessed sides facing each other, and recessed the lenses slightly inward on each side.

So, we have an optical device that allows us to view 3D on a smartphone screen. But, of course, we remember about the focus, which was changed first by introducing a second pair of lenses, and then by turning the first pair over to the other side, so the focus needs to be adjusted again. When, through simple movements, you catch the focus, you will need to notice this distance, and make foam supports of such a height that by installing your first frame above the screen, the image in the lenses will be focused.

Here it is necessary to say the following, in my opinion important property, I’m not exactly sure of its nature, but I have observed it several times in experimental subjects. Many activities in life require repeated approaches, approximation, and iteration. This, apparently, is not clear to everyone, but this method almost always works, and gives better results if you follow simple algorithm- try and improve. And in the case of this helmet, it’s the same story, perhaps you won’t be able to make two correct pairs of frames the first time, for example, I remade one pair three times, and the second twice, and I already know that I will redo it again, because there are ideas for improvements. But with each redoing, the quality increased and the picture became better, so if you made a couple of approaches, but “nothing worked out” for you, don’t despair, take a break and start again, continue. The result is worth it.

A small hint - if the resulting eyepiece (as I will call a block of two pairs of lenses and their frames, assembled together) has a good stereo image, but the focal length has increased significantly relative to the first approximations, disassemble the eyepiece in half into two frames and play with the distances, perhaps there will be a more optimal one - maybe you will need to turn one of the eyepieces the other way around, or maybe space them further away from each other. We remember what needs to be achieved maximum quantity useful pixels (otherwise it will be uninformative) and the minimum distance from the screen (otherwise it will be cumbersome). If you have a wonderful, wonderful focal length, but for some reason the stereo base is not successful, carefully cut the foam plastic in the middle between the lenses with a knife and look - you need to move them apart, or bring them closer together, and then act according to the situation. Roughly speaking, you will have two eyepieces, one for each eye, adjust them, and when it works, glue them together with double-sided tape.

At this stage, the story with the lenses ends, and now it doesn’t matter whether you made the optical design according to my version, or based on your own considerations, then it won’t be so important, the rest of the story is suitable for any option.

Helmet prototype assembly

Having found the total focal length from the eyepiece to the screen, we have to make a box on its base, and here there are even more options than at the lens stage. But, now you have in your hands the “heart”, or rather the “eyes” of the device, and its most complex part, which means that it will be easier in the future. Let's say you managed to do everything described above correctly, and you can confidently observe the 3D image by placing the eyepieces to your eyes and leaning over your smartphone. After playing around with this demo layout a lot, you will probably notice some features of the placement of lenses and the convenience of eyepieces, which you personally find most in need of optimization. Don’t limit yourself too much, optimize and improve something for yourself, for your vision, the shape of your nose and skull, and so on.

For example, after making the eyepiece, I applied it to my face and realized that I had touched it to a foam brick. There is absolutely zero convenience, and you still have to wear this helmet on your head for some time! Therefore, when making the box, I tried to increase the wearing comfort while simultaneously placing the smartphone securely and conveniently inside. I had to get rid of inside polystyrene foam, and replace it with foamed polyethylene, it is in the picture yellow. It is more flexible and allows the shape to be twisted within a wide range, which is why the inner surface of the helmet is made of it. It should fit snugly to the face in the area of ​​the eyes and around the nose, otherwise you will constantly observe fogging of the lenses from breathing, immediately take this point into account. There was an idea to make this part from a construction or swimming mask, but I didn’t have any at hand, so I did it myself, however, the option with a ready-made mask may seem preferable to you, and I happily recommend it. I myself decided to also make the sides for the helmet adjacent to the head.

Another point worth remembering is the weight of the smartphone and the lever on which it will work, exerting pressure on the support. My Xperia Ultra weighs 212 grams, and the required distance at which it is removed from the face is 85 mm, plus the own weight of the box - all this together, I would say, makes the helmet comfortable with reservations. It has one strap at the back, this will be visible in the picture at the end of the section, this strap is made of a rubber band, 40mm wide, which pulls it quite tightly to the back of the head, but if the screen was heavier, or the lever was larger (read focal length longer) - it would have been possible to wear a helmet would be much more difficult. So for owners of devices with a larger diagonal or weight, I advise you to immediately think through a mounting scheme on the head with a second, transverse strap from the bridge of the nose to the back of the head, it will be more convenient and safer.

Also, at this stage you will need to think about one more nuance - sound output. I have several pairs of headphones, both closed and open, there are earbuds and so on, but after thinking about it, I did not build a helmet around the large and comfortable Sony MDRs with large ear pads, but chose simple earphones. Perhaps it will be critical for you to make a helmet with a cool sound, in which case you need to immediately imagine how exactly you will articulate the headphones, their arch and the helmet with its mount. I had such a temptation, which quickly evaporated at the prototyping stage, but I will definitely return to it in the next, improved version of the helmet, if I decide to make it. In any case, you will need a hole in the helmet body that matches the position of the audio output of your smartphone.

So, I have this device on my desk - an eyepiece with an inner surface slightly adjusted to the shape of the head. It already sits comfortably on the face, fits in width, and to make it I only needed this template, cut from a piece of foam plastic curved to the shape of the head; it will fit, with some adjustments, to both the top and bottom of the helmet:

Previously, we found out the focal length of the eyepiece in several approaches. Now you need to position the smartphone screen at the required distance. Remember that the screen must be positioned so that its horizontal axis of symmetry coincides in height with the imaginary line between the pupils, but the fact that it must be positioned symmetrically relative to the face is already clear to you. In my case, the distance between the screen and the side of the eyepiece closest to it was 43 mm, so I made the top and bottom surface made of foam, as well as two side inserts. The result was a foam plastic box, which, once placed on the screen, could be used for its intended purpose, which is where the template shown above was needed.

At this stage there were several small adjustments to the focusing and positioning of the smartphone, after that - accurate measurement of the results obtained and cutting of the outer, cardboard case. It serves two purposes - it protects the rather delicate foam from mechanical damage, I quite easily pressed it with my fingers at the stage of initial experiments, I had to keep an eye on this, and the second and main goal is that the cardboard will hold the screen in the desired position, pressing it against the foam.

The result is a box with a lid on the top front, under which the smartphone is hidden.

Having tried the helmet on my head, and having seen enough of all kinds of 3D, I corrected minor inconveniences inside the helmet, and made a fastening - an elastic band to the head. It is simply sewn together with a ring and glued with double-sided tape to the cardboard, plus it is secured on top with a silver oracle, which was used to replace the tape. The result was something like this:

By the way, this image shows another technical hole, which is used to connect a USB cable, which we will need a little later. And this is what the helmet looks like on the head of the test subject who donated the lenses for this helmet:

So what happened in the end?
Dimensions: 184x190x124 mm
Curb weight: 380 grams
USB input/output
3.5mm headphone jack
Useful screen area 142x75 mm
Resolution 1920x1020 pixels

It's time to move on to the program part of our journey.

Available features of the VR helmet

Watching 3D video

The very first thing that comes to mind is watching movies in 3D. This is a very simple and understandable entry point into virtual reality, although, more strictly speaking, it is rather a threshold not far from it, the previous step. But, in order not to detract from the merits of this type of entertainment, I inform you that watching 3D movies in the resulting helmet is a very interesting and fun activity. I've only watched two films, so I'm not fed up yet, but the feeling is very good: imagine that you are one and a half meters from the wall that you are looking directly at. Without turning your head, try to look around the area around you - this will be the screen available to you. Yes, the resolution is small - each eye gets only 960x540 pixels from a fullHD film, but nevertheless it leaves a quite noticeable impression.

To watch movies in this form, you will need a free MX Player player with a codec installed for your processor, I have it ARMv7 Neon, and, in fact, a video file. You can easily find them on all kinds of torrent trackers, the technology is called Side-By-Side or SBS for short, feel free to search using these keywords. The player has the ability to adjust the aspect ratio of the video being played, which is extremely useful for SBS files, which otherwise stretch vertically to fill the entire screen. In my case, I needed to go to settings - “screen” - “aspect” and selecting “manually” to set the aspect ratio to 18 to 4, otherwise you will get vertically elongated images. I tried to look for other players with similar functionality, but I couldn’t find them, if you know, add them to your knowledge base.

In general, I have nothing more to add to this point - an ordinary 3D cinema is in front of your eyes, everything is very similar to going to the movies, or watching on a 3D TV with polarized glasses, for example, but at the same time there are differences, in general, if you love 3D, you should try a VR helmet.

Android apps for Durovis Dive and similar systems

This whole story actually began from this point. In principle, the following three links show almost all possible programs for Android at the moment:
www.divegames.com/games.html
www.refugio3d.net/downloads
play.google.com/store/apps/details?id=com.google.samples.apps.cardboarddemo

What do we need to experience virtual reality comfortably? Obviously - a joystick, or any other controller, for example - wireless keyboard. In my case, with a Sony smartphone, the natural and logical choice is the native and natively supported controller from the PS3, but since I didn’t have one on hand, but the good old Genius MaxFire G-12U, I added an adapter from microUSB to USB to it , hooked it up to the smartphone, and was not even surprised that it immediately began working both in the device interface and in individual programs without any questions.

You will also need headphones, because immersion in virtual reality without sound will be incomplete. I have these ordinary plugs, and you can figure out for yourself which is more convenient.

What should you expect and what should you not expect from the applications presented in this section? The fact is that all applications in general that are written for Android on the topic of virtual reality are very meager, to put it mildly. If you run them without a helmet and try, well, to see what kind of virtuality this is, then there is a chance that you will not want to buy or make a helmet. They are frankly very crude and miserable, and do not represent anything super-interesting.

But. When you put your head in the helmet, everything becomes completely different, and personally, I, skeptical of everything, would never believe it, but nevertheless it is so.

The main thing to consider is head movement tracking. Even with poor implementation, or slowdowns, this is a completely new and unexplored field of sensations, believe me, before the advent of the helmet, you had not felt anything like this for a very long time, since the times of adventures with rock climbers in the mountains, walks along the bottom of the oceans, overnight stays in the forest and other massive murders that we all love so much. The helmet provides a completely unrealistic sense of reality, I apologize for the pun, and any, even the poorest graphics will seem like candy inside it, in general, I must say - if you like to play games, or experience new things, the helmet is the device for you.

From own experience: imagine you are in 1998 and, say, a Polish production studio computer games I made a demo in which you landed on the moon, exited the module, saw the canonical American flag, looking like a piece of cardboard nailed to a stick, stuck in the ground, and above the flag in the sky there was an inscription in the sky in an extremely poor font “gather your tools, 3 pieces left.” At the same time, the graphics are made up of very, very simple elements, where the monotonously copied starry sky and the square-repeating soil under your feet occupy 98% of the usable screen area, and somewhere a couple of pixels of those “tools” that you have to find are visible. Not really. You can already see them, you just need to walk to them for 10 minutes. Just go. By the moon. No sound. By repeating sprites. No action at all.

Tell me, after how many seconds would you delete this game from your computer or even your smartphone? That's it. And wearing a helmet, this miracle allows you to experience (!) the devastation and loneliness of the only person on the planet. No joke. After 15 minutes of the game, I found myself desperately afraid that I was alone on the Moon, under a canopy of stars, and it was completely unknown what to do.

More or less the same story with all other games and applications. They are miserable, they are creepy as hell, but at the same time inside the helmet - they send you back 15-20 years ago, and who even earlier, to the very games that they played, and not with which they spent time. So far, my only question for the developers is - why isn’t there a single game with a full-fledged plot for this scenario? A single game would save the situation incredibly, because now, showing people virtual reality on Android, there’s nothing special to show, everything with the reservations “this is a demo, you can’t shoot here,” and “that’s it, the whole game is completed, yes, in 4 minutes." By the way, almost all of these applications are written in Unity, which makes them all the more surprising low level, or I don't know how to search.

But don’t listen to me anyway, try it yourself and tell me your version, I’m interested. And season it with links, I will do it immensely. For example, I even installed a demo with the outrageous name Toilet Simulator. Because.

A small easter egg

In fact, on the Durovis Dive website there is a link to Quake-2, a demo version of the game that can be installed on Android and has the ability to display SBS mode; at the bottom of this page there are detailed instructions on how to do this. The only thing that did not work in automatic mode was that a separate archive was not unpacked, so it will be there in the settings running game links to mirrors, you need to retype one of them into the browser on your desktop, download the self-extracting archive, pull out the pak0.pak file from there and put it in the directory of the game installed on your phone, I have it called baseq2.

After that, the same Q2 started up for me without problems - it works very quickly, and everything is clearly visible. It became scary after literally 30 seconds, a chill down the spine, but I won’t describe it further, try it yourself. It was not possible to take a screenshot, unfortunately, and the joystick currently only works in the “wander” mode, it can’t shoot, you’ll have to tinker with the settings.

Thus, all this sluggishness of Android developers (attention Android developers!) led me to the thought - well, there are no games for Android - let's try a desktop computer, keeping in mind the main advantages of a virtual helmet - a huge screen with immersive image and position tracking heads, and try not to lose them.

Connecting to a computer as a VR device

To be honest, the idea of ​​such a connection appeared immediately, but there was not a single idea of ​​how, what and in what order to do it. Therefore, while I was drawing, cutting and gluing parts, I was simultaneously thinking about where to get information on how to display an image from a computer’s video card, while simultaneously transferring head tracking, that is, gyroscope and accelerometer data to the computer. And all this, preferably with minimal delay.

And you know, a solution was found. It consists of three stages, each of which we will consider separately, and first I will describe the working options, and then I will go through those that turned out to be ineffective in my case, but may be useful to you.

We create 3D output on a computer.

It turned out to be relatively simple, but without knowing right away, you can get lost. So, the ideal computer that allows you to play full-fledged 3D games in stereo output format has a video card based on conventional NVidia or ATI chips, the more modern the better, and, what is very important, the drivers have the ability to configure an arbitrary resolution. If you have a laptop (my case) or a video card whose drivers do not support arbitrary resolutions, the image in the helmet will be elongated vertically, and a possible solution, unsafe and rather tedious, is to delve into the registry and register permissions there. Your suggestions, again, are warmly welcome!

In general, you will need to install a version of the video card drivers that supports arbitrary resolutions. If your smartphone and your monitor each have 1920x1080 pixels on the screen, then everything is very simple - in the video card settings you need to create an arbitrary resolution of 1920x540, and then apply it to the monitor. You will see how the working area of ​​the screen has become smaller in height and is located in the middle of the screen. If the picture on your screen is something like this, then you did everything right:

So, everything was tested on a regular but powerful desktop computer with an NVidia video card and latest version drivers. It is important that the conditions are met - when running the game in stereo mode, the image on each half of the frame is not elongated.

The second thing you need is to download the 3D driver - which has a full trial version for a period of two weeks, and allows you to output 3D images to peripheral devices in arbitrary configurations, side-by-side, top-bottom, and anaglyph, in basically, whatever you want.

Install in the usual way, launch the TriDef 3D Display Setup utility and select the Side-by-side option, now when you launch games from this driver, they will be in stereo mode “each eye has half a frame.” If you have games installed, then you can open the TriDef 3D Ignition utility and search for installed games, a shortcut to your game will appear in the window - voila, you can use it.

I didn’t have any games installed, so I installed Steam and bought Portal 2 for 99 rubles on sale, but this is an advertisement. And here comes a point that you need to be aware of - the driver that serves stereo output can output stereo for any game that can be launched in full screen, but cannot create output for a window whose area is smaller than the size of the desktop. Remember this point, below it will become critical, like a red rag to a bull.

In general, if the drivers are installed and configured, the game is purchased and launched, and it all looks something like this on the screen:

You can move on to the next stage.

Transferring an image from a computer to a smartphone screen

There are several ways here, and judging by the numerous icons in the market, there are not so few programs that allow you to convey what is required. I was “lucky” before I found a convenient and workable application, I tried several other, depressing and frustrating hacks from Google Play, and I’m sorry that they put any slag there. I spent more time searching and setting up applications than making the device. Moreover, I had to buy one of the applications, and everything would have been fine with it, if everything had not been bad. But first things first: you will definitely need a local Wi-Fi connection between your computer and smartphone.

You will also need a good and fast "remote desktop" that does not log you out of your account on the desktop when logging in via remote control. Such a program turned out to be the free Splashtop, and the half-paid iDisplay was also found.

The one that is paid - everything is fine with it, only it did not allow placing the screen cropped at the top and bottom exactly in the middle of the display, so I had to abandon it, but overall it works well, there was even a review on Habré, where I got it from. But Splashtop worked as it should, so install it.

All programs of this type work in approximately the same way - you need to download and install the host version for your desktop, and the receiver version for your smartphone. I think there won’t be any problems with this, so I won’t describe these processes, it only takes about five minutes of work - downloaded, installed, registered, configured, connected. The only thing I will mention is that you will need to go to the settings and indicate that your wireless connection needs to be used locally, for which you will need to explicitly specify the IP of your computer in the Android version, you can find out this address using the ipconfig utility in command line. Actually, these are all the settings, everything should already work, here, for example, is a screenshot from a smartphone at the moment:

If you launch the game from the 3D Ignition utility, it will appear on the screen of your smartphone at the same time as it will appear on the monitor. Or not. Because here lies the hottest pitfall of our history, and yes, you will laugh as much as I did. Watch out for sleight of hand: the driver that displays a stereo image from the game requires full screen (if you select the “windowed” mode, stereo will not work, the game will launch normally), and the program for accessing the desktop from your smartphone screams “I can’t” launch fullscreen, sorry, yes, absolutely,” and can only show the desktop and the windows on it.

Therefore, the most subtle point. Most likely, you will be able to play any games that run in the “borderless window” mode. I don’t know for sure why and where such a mode exists in games, for this reason, or for some other - but it turned out to be a salvation: on the one hand, it deceives the desktop and tells it that it launched the game in full screen, and on the other hand, it formally displays only a window on the smartphone, albeit without frames and expanded to fill the entire screen. This is the same case when the wolves are fed and the sheep are safe.

So I was lucky, Portal-2, which I downloaded from Steam, turned out to be exactly the game that supports all three launch modes. So you just have to check at your own discretion which games will launch this way and which won’t.

Now you can launch the game and play it wearing a helmet. But, as they say, the picture would be incomplete if there were no head movement tracking.

Connecting head tracking

You have read this far, for which I congratulate you. I don’t want to deceive you, this point is the most complex and least studied, however, do not despair. So.

The first thought was to “disassemble” the Oculus Rift SDK or Durovis Dive SDK, fortunately the sources are in open access. Perhaps this should have been done, but I am not a programmer, and I don’t understand anything about this. Therefore my gaze was turned to ready-made solutions, which transmit the position of the smartphone in space to the desktop. As it turns out, there is simply a gigantic number of programs that supposedly can do this. Judging by the descriptions, almost everything is like that. And again, I went through dozens of programs with sweet promises, but in reality it was even more scary, disgusting and wretched than going through programs to display images on the screen of a smartphone, and what’s more, even more wretched than those demo games for Durovis Dive, which I described above. If at this stage you catch a wave of frustration, then that’s it, “goodbye helmet.” Nevertheless, the necessary (with reservations) program was found. But first, a fly in the ointment - Monect, UControl, Ultimate Mouse, Ultimate Gamepad, Sensor Mouse - all this did not work. Especially the first one on this list - the description says that Monect Portable provides a mode

FPS mode - Using gyroscope to aim the target just like a real gun in your hand, perfect support COD serial!

As a result, I bought it for a fabulous 60 rubles, but this turned out to be untrue. This mode simply does not exist in the application! I was angry.

But let's move on to successful options. You will again need to download the host and client version of the program called DroidPad. It was she who, when setting up one of the modes, made it possible to do the necessary and transmit the parameters of the sensors in real time via wireless access. The algorithm is as follows: install the program on your desktop and smartphone, launch it on the smartphone, select the “Mouse - Mouse using device tilting” mode, and then launch its desktop version.

If everything is done in this order, the connection should work, and voila - you control the mouse cursor on the computer screen! So far it’s chaotic and chaotic, but wait, we’ll set it up now. In my case, in the Android version of the application, the screenshot of the settings window looks like this:

You can set the name of the device, but it’s better not to touch the port - it works by default, but it’s better not to touch what works for now. In the desktop version, everything is a little more complicated, my settings are like this, but they still need to be optimized, so use them only as a guide, nothing more:

Here are the X and Y axis settings on the computer screen, and the sensor strength from the phone. How exactly this all works is still a black box for me, because the application developers do not provide any documentation, so I provide the information “as is”. I completely forgot to add that I have a program installed on my smartphone that controls the launch of applications in landscape or portrait orientation, and all the applications that were tested for this venture were tested in landscape mode. The application is called Rotation Manager, and auto-rotation of the screen is globally disabled on the smartphone.

Having configured your applications accordingly, you will need to connect your smartphone to the computer according to the algorithm described earlier (for me, any discrepancy with the specified order leads to the termination of the application), and, holding the smartphone in your hand as it will be located inside the helmet, try to configure the settings - alternately adjusting the desktop sliders and clicking on the “Calibrate” button in the Android version window. I’ll say right away - after quite a few attempts, I managed to adjust the angles and turns relatively decently, but then, while adjusting more precisely, I lost those settings without thinking about taking a photo of them, and those that are now in the screenshot are only an approximation to the previous ones that were It still feels better. One more thing - all these sliders are very sensitive, and holding the smartphone in one position in your hand so that it does not move the cursor arbitrarily is inconvenient, so you constantly have to disconnect the connection and configure, then connect and check. After some time, the information in the article on this subject will be updated, but even with the current settings - inside game world it looks quite impressive.

So, how does it feel? On at the moment Due to lack of time, I have installed the games Portal 2 and the free robot shooter HAWKEN, offered by Steam. As for the portal, you are quickly enslaved by the surrounding atmosphere and sound, and the immersion is so strong that there is nothing to compare it with, except maybe sitting in front of the computer 10 years ago at four in the morning, everything is perceived about as acutely. But if there it was fatigue and darkness around, then in the helmet it was a slightly different, brighter effect of the same presence. But the second game, where you sit in the canonical “huge humanoid robot”, surprised me. If you have a helmet on your head, reality, projected as if onto the surface of the helmet in the game, becomes closer, warmer and brighter, and very quickly. Amazingly fast.

You shouldn’t assume that the sensations caused by a VR helmet will be the same for everyone, but based on all the “guinea pigs” I can confidently say that absolutely everyone appreciated this device, the reviews are extremely positive and interested. Therefore, I confidently recommend that you spend one day making this helmet and judge for yourself. My personal goal was exactly this - to quickly satisfy my curiosity, without specially wasting money and time on waiting. I spent about three days of searching and setting everything up, and now I’m passing the baton to you, in a condensed form.

Personally, I decided that I would most likely make a second version of this helmet, with minor modifications and improvements, and subsequently purchase the latest consumer version of the Oculus Rift. It turned out to be very interesting and informative.

I’m really looking forward to new applications for Android, and partly this article was written with the hope that one of the developers will become interested and reveal some interesting stuff for everyone to see. And, a small wish - if you know any programs and solutions that I did not mention, but which would expand the quality of the article and improve the performance of the device - write about them in the comments, and I will definitely add valuable information to the article for future generations.

TL;DR: the article describes a fast and high-quality method for making a virtual reality helmet based on an HD smartphone or tablet with Android on board, complete step by step instructions And general principles this process, and also describes the main available methods Applications of the resulting helmet: watching movies in 3D format, games and applications for Android, and connecting the helmet to a computer to immerse yourself in the reality of desktop 3D games.

Good afternoon (evening/night optional).

Today I’ll tell you about how you can make virtual reality glasses with your own hands, no phones(Traffic!):

PREFACE

For now NO official standard for VR glasses/mask and the like. About Oculus, HTC, Samsung, Sony, etc. there is no point in talking and comparing. These are just devices with different functionality +/-, some gadgets. There is no point in arguing about what VR is, everyone sees it differently.

I’ve been wanting to play with this kind of thing for a long time, but phone glasses don’t appeal to me, they’re inconvenient, heavy and there are few applications, poor synchronization with the PC, phone battery, radio delay.

In the process of working on my experiment, 2 nuances that were important to me were highlighted:

1. Head tracking.
2. Display instead of a phone.

Based on these nuances, I started building the unit.

I’ll say right away that the thing is in itself and does not pretend to be of quality; anyone can repeat the production of this helmet based on the instructions received.

COMPONENTS

For the glasses I needed the following components:

MATERIAL PART

The first thing is a warning:

All responsibility, namely independent penetration into the body of the finished product with subsequent violation of its integrity and performance, lies with the person who committed this action.

Frame:

The body will have to be assembled separately for the matrix, due to the fact that the matrix is ​​quite voluminous and a different focusing distance is required. Lens replacement required. The part that will be applied to the head and nose will be taken from this body.

Controller:

The main task is to synchronize the controller with the matrix, I knew that the controller and matrix would work, but whether I would get the required resolution is another question.

I’ll give you an excerpt from the datasheet:

My display has an aspect ratio of 16:9 and a resolution that falls within the 1920x1440 range.

The problem is that the controller has the wrong resolution and needs to be flashed.

Initially, when connecting the display, instead of a picture, I received a set of stripes. (I even thought that the display itself was covered).

But after a while (when connected to a computer) it became clear that the display was displaying something, but it was clear that it had a problem with synchronization and resolution.

When installing the firmware, I went through more than a dozen and settled on this version:

Now, when connected to a computer, the display displays information that an HDMI connector is connected and offers a resolution of 1024x600. In this case, the display actively tries to receive a signal from VGA, and the message “Connect the VGA cable” appears.

I had to scratch my head again. This controller is a direct analogue of boards with a large number connectors, for example:

This means you need to wire up buttons to your controller so that you can customize the display and switch operating modes. I have attached a diagram for the connectors, the buttons hang on the 53rd leg of the chip:

Just in case, I am attaching a diagram of the RTD2660 chip:

After flashing the firmware and switching the controller to HDMI mode. The display began to start under WIndows 7, my surprise was great when, in addition to the native, native resolution of 1024x600, I was able to set the resolution to 720p and 1080p. At 720p it works great without being distorted, but at 1080p the fonts are no longer readable, but it holds it just the same, surprise, running games at 720p is more fun than at 1024x600 (not all games support low resolutions).

Matrix:

I was already playing with glasses on my phone, the resolution was 960X540. I launched Half-life 2, Portal, but I didn’t like the fact that it was a phone and the fact that I couldn’t look around the space with my head, I rotated the mouse + delays via Wi-Fi, they just infuriated me and didn’t let me play. In general, the pixels are visible, but I still liked it.

A 7-inch 1024x600 matrix, part number 7300130906 E231732 NETRON-YFP08, was removed from the spare parts box. Based on the available matrix resolution, we can conclude that for each eye the resolution will be 512x600, which is slightly more than the phone screen resolution and, most importantly, there will be no delays.

The matrix connector has 50 pins and is fully compatible with the display controller.

To achieve maximum contrast and image richness, you will have to remove the matte film from the matrix. Since the product will be closed, there is no risk of any glare.

Finalization of the matrix is ​​carried out in 7 stages:

1. disassemble the matrix along the edge of the frame;

2. place the module on the lining (here you can tape the edges of the module to the lining so that water does not damage the part);

3. Place a damp cloth on top of the display, preferably the size of a matte film;

4. Gently soak the napkin with a small amount of water at about 25 degrees;

5. wait about 2 - 3 hours, it all depends on the quality of the coating. (the glue of matte films is sensitive to water);

6. carefully pry up the edge and slowly, without jerking, remove the matte layer;

7. check.

If you want to collect glasses on a 2K display, then I will give you a link:

For this price on Ali you can buy a ready-made device with FullHD ->

Therefore, I did not spend money on the concept and decided to use what I had for testing.

Arduino and gyroscope:

The most important part Getting the effect of presence in a game, application or video is the ability to control your head, which means we will write head tracking.

Excerpt from the official source for Arduino Leonardo:

Unlike all previous boards, the ATmega32u4 has built-in support for a USB connection, this allows you to set how Leonardo will be visible when connected to a computer, it can be a keyboard, mouse, virtual serial / COM port.

This is exactly what I need.

The simplest and most common gyroscope was chosen - GY521, which has an accelerometer on board:

1. Accelerometer ranges: ±2, ±4, ±8, ±16g
2. Gyroscope ranges: ± 250, 500, 1000, 2000 °/s
3. Voltage range: 3.3V - 5V (the module include a low drop-out voltage regulator)

Gyroscope connection:

#include #include #include #include MPU6050 mpu; int16_t ax, ay, az, gx, gy, gz; int vx, vy; void setup() ( Serial.begin(115200); Wire.begin(); mpu.initialize(); if (!mpu.testConnection()) ( while (1); ) ) void loop() ( mpu.getMotion6( &ax, &ay, &gx, &gy, &gz); vx = (gx+300)/200;

Based on the sketch, we can conclude that head tracking is essentially a gyro-mouse.

CONCEPT

It all came down to the division into stages:

1. trying on head tracking;
2. writing tracker firmware;
3. ordering the required controller for the display;
4. setting up and launching the display with the controller;
5. fitting and general assembly.

This is what debugging a head tracker with a gyroscope looked like:

Video of the head tracker in action:

Running the display with a controller:

To run the display, I need the Tridef 3D program, which allows you to run games and applications with Side by Side images, which I used as a test.

The reason for use is quite clear, these glasses will not be recognized as Oculus DK1/DK2 glasses and in order for the device to be recognized as VR glasses of at least the first revisions of the oculus, it must be completely changed software display controller, which I can’t afford yet, it will also require either partial prototyping, or creating again a concept board based on the kind of gyroscopes that are used in oculuses -

But due to the fact that I decided not to spend a lot on this project and I’m not going to make money from it either, we’ll leave that for other people. (I know who makes sets with oculus firmware based on similar glasses for smart phones, but I won’t advertise them, the post is not about them)

Frame

Having played enough with the standard case, I decided to try on the matrix for it and was very disappointed, the matrix turned out to be too big for focal length, I saw everything, but I didn’t see the whole picture, it didn’t add up into one.
The assembly of the body began from scratch.

Having broken off all the protruding parts, as well as the fastening of the head strap, I got the following set:

Actually, like many prototypes, I chose corrugated cardboard, as the most flexible, easily accessible material:

Testing

During testing, the glasses performed extremely well; playing at 720p resolution is a pleasure. The gyroscope works great and follows head movements, the mouse does not float along the coordinates, I passed the cable through my head behind me, 3 meters was more than enough.

Nuance:
The glasses stick out quite a lot, although the mass is not very large, you have to get used to turning your head.

Disadvantages of such a system:

1. You need a smaller matrix in order to reduce the length of the body.
2. You need high-quality lenses (for mine, I took them from magnifying glasses at the nearest print shop).

In general, for myself, as an undemanding person, it will do.

Once I’ve played enough with it all, I’ll make an 8D projector from this matrix and controller. (Keep an eye on the reviews)

Thank you for your attention and patience, I will be happy to answer your comments.

This video tutorial will show you how to make cardboard 3D virtual reality glasses. For this we need a phone, two lenses, a pen, a ruler and a cardboard box (thick cardboard). It is recommended to use lenses 5-7x, diameter 25 mm. The article consists of two parts. The first contains the basic steps for creating glasses, the second contains recommendations for improving the product and a description of applications for 3D games.

Buy ready-made cardboard glasses you can in this Chinese store.

From cardboard you need to cut out all the parts that will be needed to create the glasses. To do this, it is very convenient to use the diagram, which you can download from the link. It will make everything much easier to do. You can download this drawing for printing on a printer.


Now, according to this diagram, you need to draw out all the details on cardboard and cut them out using scissors. Next you need to collect it all, which is, in principle, not difficult to do. In all places where there are bends, you need to bend the cardboard and connect everything using hot glue. Next you need to insert two lenses.

If you made the hole a little smaller than the lenses themselves, then you can simply place them very tightly and they will not fall out, but just in case better a couple drops of hot glue.

Now we need to download an application called cardboard to our phone. There's a lot in it different games for 3D glasses and videos. You can download the demo version from the Play Store.

Let's finish the 3D glasses. We insert the cardboard with lenses and we are all ready!

Go to the cardboard program. There are two sections here. There are many different games and videos here. We launch the one we like and insert it into our 3D glasses and enjoy virtual reality.

Since the phone has a built-in accelerometer, we can move our heads and the picture will also move.

There are many applications for these 3D glasses on the play market. Make these glasses or buy ready-made ones. In general, this cannot be explained, it’s very cool! Until you try it yourself, you won’t understand what it all looks like.

How to make a reality simulator for a personal computer

Next, we will show you how to make a reality simulator for a personal computer, these are virtual reality glasses like the Oculus Rift. To do this, we need straight hands and a well-functioning head and motivation to create homemade products. If you do not have any of these qualities, but have money, then it is better to immediately buy ready-made virtual glasses.

We will need a virtual reality helmet, which you could make using the video tutorial above. The current version adds larger lenses, head mounts, and Velcro to help the phone hold better. In general, this craft is assembled more carefully.

Where can I find lenses? You can take from the magnifying glass which contains two lenses that are perfect for these virtual glasses.

We will need a more powerful computer and a telephone with good characteristics so that all programs work stably and do not freeze.

You need to download a program called droidpad to your computer or phone. This application will help us use our phone as a virtual joystick. Namely, use the phone’s accelerometer itself. This application supports two types of connecting your computer to your phone: using USB and WiFi. We don't need it using usbi, because the phone will be inserted into the virtual glasses. Therefore, we will use the wi-fi method. It is desirable that the Internet speed be good and stable.

Now we have the most difficult work ahead of us. We need to calibrate the accelerometer of the iPod phone to our computer. After installing this program, the phone will be used by default as a virtual phone in games. Certainly not all games will be supported. Instructions for calibrating a phone with a computer are available on the 4PDA website.

After we have calibrated according to the phone instructions for the computer, you can go into any game and test your magic glasses. The mechanism of this application is that using the phone's accelerometer, when you turn it, the screen rotates. It turns out to be a replacement for a computer mouse. Additionally, we need a program called cardboard. This program is needed to make the phone screen split in half. There is a special function, be sure to find it and configure it correctly so that everything works for you. Check that the phone screen is correctly divided not only on the desktop, but also in other programs.

Finally, download the latest program called Splashtop. This is a program so that we can view the computer screen through the phone. How to set up the program, instructions are also available on the 4PDA website.

After we have downloaded the program to the computer and phone, we need to launch the droidpad program to control the accelerometer, the cardboard program to divide the screen in half. These two programs must be running in the background. You need to open the Splashtop program and check if everything works. Launch the game on your computer and enjoy.

There is one caveat - the higher the pixel density on the phone, the clearer the picture will be. Besides games, of course, you can watch movies.

Everything voluminous is becoming fashionable, and many people want to have it in their home for creativity.

Virtual reality glasses allow owners to move into a completely different world - three-dimensional. Such glasses cost a lot of money, but we suggest not rushing to the store or ordering them in online stores, since such glasses can be made at home.

First of all, we suggest devoting a few minutes to watching the author’s video

What do we need:
- a smartphone running Android OS;
- two lenses;
- pen;
- ruler;
- cardboard box;
- scissors.


Before starting production, we note that we recommend using lenses from an old unnecessary flashlight. Let us also clarify that the cardboard must be chosen thick so that it can support the weight of the smartphone.

Let's start by cutting out all the necessary parts from cardboard box. In the figure below, you can see a diagram of cardboard blanks, according to which you can prepare all the parts.


Before you start cutting out the parts, you need to draw them on cardboard. To do this we will use a ruler and a pen.


When all the drawings are ready, you can start cutting them out using scissors. According to the author, if you accidentally cut a part incorrectly or inaccurately, then the error can be corrected with a glue gun.


After we have cut out all the parts, we need to assemble it all into one structure. For greater convenience and stability of the structure, you can additionally connect all the parts with a glue gun.

Now you need to insert two lenses into a separate piece of cardboard. To do this, you need to make two holes on a piece of cardboard. In principle, if the holes are slightly smaller than the diameter of the lenses, then this can be considered a plus, since in this case the lenses will be inserted into the cardboard in a very tight manner.


But in any case, you can fix the lenses with a couple of drops of hot glue.

You can go away for a while and start downloading the “Cardboard” application on your smartphone, the demo version of which can be downloaded on the Play Market. In principle, in the vastness of the network you can find an already hacked full version applications.


While the application is downloading, you can continue making glasses. We insert the cardboard with lenses into the glasses. After this we can say that our glasses are ready.

Many of you have heard about Google Cardboard! A long time ago we wrote on our website about the exit of this device! Now every owner Android smartphone can buy it and download a bunch of games and applications under Google Cardboard on the official website!

Buying it is of course all great. But what about making a virtual reality headset yourself? And so, we will now tell you how to do this.

1. Take everything you need

What do we need to do this miracle? So, you need to get: cardboard (you can buy it at a creative supply store), lenses, magnets, as well as Velcro and elastic.

2. Download the drawings

In the future, if our readers want and are active in the comments, we will write instructions in Russian.

Non-standard solutions

When you make your virtual reality glasses, don't forget that you can get creative with your ideas. Decorate your Cardboard beautifully. The image above shows a very nice Google Cardboard called POWIS VIEWR. This model will cost you $30. Now it’s about 2,000 rubles. It may not seem expensive, but making something original yourself is much cooler!

Camera Jump

If you are very pleased with these gadgets and you have extra money, then you can get a gadget like Jump. What is it? This is a peculiar design of 16 chambers, it all looks like a ring.