Unity - 适用于 Google Cardboard 的 Photosphere Photo Viewer [英] Unity- Photosphere Photo Viewer for Google Cardboard

查看:29
本文介绍了Unity - 适用于 Google Cardboard 的 Photosphere Photo Viewer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Unity3D 构建类似 Photosphere 的应用程序,并将其与 Google Cardboard 一起使用.

I am trying to build a Photosphere-like application with Unity3D and use it along with Google cardboard.

我需要加载不同的全景照片并能够通过使用 Cardboard 护目镜立体地查看它们.

I need to load different panoramic view photos and be able to view them stereoscopically, by using the Cardboard goggles.

我在使用全景图像并将其渲染为 Unity 中的立体视图时遇到问题.

I am having problem to use the pano images and render it into stereoscopic view in Unity.

如有任何建议,我们将不胜感激.

Any suggestions will be gratefully received.

推荐答案

我能给你的最简单的解决方案:

Simplest solution that I can give to you:

A.使用 Android Pro 插件安装您的 Unity Pro,设置Cardboard SDK For Unity,安装 Android 构建工具和 SDK.

A. Install your Unity Pro with Android Pro plugins, setup Cardboard SDK For Unity, install Android Build tools and SDK.

B 设置天空盒

  1. 获取立体全景图像(可能需要加载图像需要一段时间,因为它是高分辨率图像).

  1. Get a stereoscopic panorama image (Might take a while to load the image as it is a high resolution image).

在 Unity 中,导入图像,将 Texture Type 更改为 Cubemap.选择映射圆柱(纬度和经度).

In Unity, import the image, change the Texture Type to Cubemap. Select the Mapping as Cylindrical (Lat and Long).

创建一个材质,将着色器更改为天空盒/立方体贴图.

为材质指定纹理.

在 Unity 5 Pro 顶栏中,选择 Window -> Lightthing,将材质拖到 Skybox 属性.在这一步中,您可以以编程方式进行.将这些步骤与 Cardboard 资产和游戏对象结合起来.瞧,你已经制作了一个 VR 全景立体 Cardboard 应用程序!整个设置只需花五分钟(不包括设置工具:D).

In Unity 5 Pro topbar, select Window -> Ligthing, drag the material to the Skybox property. In this step you can do it programmatically. Combine these steps with the Cardboard assets and game objects. Voila, you've made a VR panorama stereoscopic Cardboard app! The whole setup is just take out your five minutes(excluding setup your tools :D).

如果您熟悉 Unity,您就会确切地知道按照我的指示该做什么.如果您在我的步骤中停留在某个地方,请随时问我.快乐编码:)

If you're familiar with Unity, you know exactly what to do on my instructions. If you stuck at somewhere in my steps, feel free to ask me. Happy coding :)

额外提示:您可以将大纹理文件制成资产包,就像存储在服务器中的动态内容一样.您的应用程序只是一个小型的空应用程序.当应用程序启动时,从服务器请求和下载资产包,然后操作纹理.:)

Extra tips: You can make the large textures files into Asset Bundles, act like a dynamic content which is stored in the server. Your app is just simply a small-size empty app. When app launches, request and download the asset bundles from server then manipulate the textures. :)

额外提示:不要忘记在 Android 构建设置下生成资产包.否则,当捆绑包下载到 Android 手机时,您的纹理将被破坏.

Super extra tip: Don't forget to generate asset bundles under Android Build Settings. If not, your textures will be corrupted when the bundle is downloaded to Android phones.

这篇关于Unity - 适用于 Google Cardboard 的 Photosphere Photo Viewer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆