Unity- Photosphere Photo Viewer for Google Cardboard [英] Unity- Photosphere Photo Viewer for Google Cardboard
问题描述
我正在尝试使用Unity3D构建类似Photosphere的应用程序,并将其与Google纸板一起使用.
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 Build工具和SDK.
A. Install your Unity Pro with Android Pro plugins, setup Cardboard SDK For Unity, install Android Build tools and SDK.
B设置Skybox
B Setup Skybox
-
获取立体全景图像(可能需要需要一会儿才能加载该图像,因为它是高分辨率图像.
Get a stereoscopic panorama image (Might take a while to load the image as it is a high resolution image).
在Unity中,导入图像,将纹理类型更改为立方体贴图.选择映射作为圆柱(纬度和经度).
In Unity, import the image, change the Texture Type to Cubemap. Select the Mapping as Cylindrical (Lat and Long).
创建材质,将 Shader 更改为 Skybox/Cubemap .
将纹理分配给材质.
在Unity 5 Pro顶部栏中,选择 Window -> Ligthing ,将材质拖到 Skybox 属性.在此步骤中,您可以以编程方式进行操作.将这些步骤与Cardboard资产和游戏对象结合在一起.瞧,您已经制作了一个VR全景立体Cardboard应用!整个设置过程只花了5分钟(不包括设置工具: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- Photosphere Photo Viewer for Google Cardboard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!