Introduction to the introduction of VR in illustrated--GOOGLEVR

Source: Internet
Author: User
Tags google vr unity 5

This article is written by Cartzhang, reproduced please indicate the source. All rights reserved.
Article Link: http://blog.csdn.net/cartzhang/article/details/52959035
Cartzhang

This article is based on, suitable for pure small white, but also please the great God around.

VR starts with the cardboard of Google VR that looks the simplest.
Google publishes Cartboar to experience virtual reality in a simple, fun and inexpensive way.
Its use to look at the majority of panoramic video, of course, there are other different uses, can play on the phone, it is sure to play a variety of tricks.

First of all, all the tutorials in this illustration are based on the window,
Image reference word github, address: https://github.com/cartzhang/UnitySay/tree/master/GoogleVR_1/Img

If you do not see the picture, you can download it yourself.

First, look at the resources we need:

One, the required resources 1. Unity


is currently using the newer version of Unity 5.4.0f3,

Untiy each version address:

https://unity3d.com/cn/get-unity/download/archive?_ga=1.41972967.311279473.1476870291


1> of which 5.4.0f3 its official:

Http://download.unity3d.com/download_unity/a6d8d714de6f/Windows64EditorInstaller/UnitySetup64-5.4.0f3.exe?_ga= 1.147305973.311279473.1476870291

Found in file after download


2> Of course you can also download by downloading:

Https://unity3d.com/cn/get-unity/download?thank-you=update&download_nid=41345&os=Win

To say, if you are an earlier version of unity, you need to download the
Unitysetup-windows-support-for-editor-5. .. * To enable support for the window platform.

Of course you are based on your computer platform to choose, android,ios,windows and so on.
The download is complete like this:



Then install, all the way to click Next, will come to this interface, please follow the need to choose, here on the map to select these are enough.


The following is the question of choosing the installation and download path:


After the download is automatically installed to the folder you just selected, if you do not choose to save the directory, the installation files just downloaded will be automatically deleted after installation.

3> the rest is installed, all the way next.

2.GoogleVR Plug-in


Google VR's support for unity is in the form of plug-ins, whose code is open source, and the GitHub address is:
https://github.com/googlevr/gvr-unity-sdk/tree/v1.0.1

In fact, we are only concerned about the plug-in temporarily:


Click Open, see the download, the direct download is done.

Ii. Example 1. Establish a project engineering

Using unity to normally open a project, I use the empty item here and then import the unity sauce from the official.
If already downloaded can be found here, Direct import:



And then:


Results such as:


The Unity sauce appears in the scene.

2. Import the GOOGLEVR plugin

Import the Downloaded plugin:
! [Write a description of the picture here] (http://img..csdn.net/20161028183726031)

Open it


You can also drag and drop the plugin directly into project, or you can implement the import.
Click Import:



This will appear in the middle of the message:



This is not important, primarily for version compatibility issues.
This problem does not occur if GOGLEVR uses version 0.9 in UNITY5.4.0F3.
It's not a matter of choice here. However, it is best to choose the import package for future versions.

3. Setting up the camera



The camera position needs to be set. First create an empty node, then drag the main camera underneath the cam.



Note: The camera controller script under main camera is checked out because it controls the camera and Google VR needs to control it. This is a conflict.

Final projects such as:

4. Results:


There are different buttons next to each other, and you can test them for different animation actions.
The lovely unity sauce is coming out.

Three, packaging


Install Unity's Andriod package,



When set to take into account the need for a horizontal screen to play the game, you need to set the default Orientation


If there are some environments that are not installed, click Install, install updates automatically



A long wait, and so on ....
If you have installed Andriod software, you will be packaged directly.
About Unity's andriod packaging use:
Reference:
http://blog.csdn.net/techtiger/article/details/21534893

Need to install Android SDK and JDK, related content reference connection.

Next set:


In order to see this package, I spent two days, the speed of limited speed, it is really difficult.
No compressed picture, around 25M.

Four, mobile phone


Note that the phone is used according to Andriod 5.0 version.

Pour yourself onto the phone. Because the code is written in control, you can see directly.


Import into the phone to see what we've struggled to fix with Unity Chan.



What the hell is this? Rushed to the face up, frightened me, the difficulty is the cone to cut?

Anyway, it's finally done.

Five, the source code


Source Address: Https://github.com/cartzhang/UnitySay/tree/master/GoogleVR_1

Game APK Package Address:

https://github.com/cartzhang/UnitySay/blob/master/GoogleVR_1/Gvr01/mRelease/unitychan.apk

Vi. references

[1].https://developers.google.com/vr/unity/

[2].https://developers.google.com/vr/unity/release-notes

[3].https://vr.google.com/cardboard/

[4].https://developers.google.com/vr/

[5].http://blog.csdn.net/techtiger/article/details/21534893

[6].http://bbs.9ria.com/thread-219753-1-1.html

[7].http://www.cnblogs.com/nsky/p/4594371.html

[8].http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

—————— –the-–end ——————

If you have any questions, please feel free to contact us!!
Thank you so much!!

Introduction to the introduction of VR in illustrated--GOOGLEVR

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.