GearVRf使用说明

来源:互联网 发布:开淘宝店描述怎么写 编辑:程序博客网 时间:2024/05/23 00:37

GearVRf使用说明

Xdestiny @ 2016/2/24

预先需要准备好的东西

  • GearVRf库文件(已经预编译好的)。我们需要的就是其中的libs-gvrf.zip。当然也可以自行重新编译,不过官方只提供了Eclipse下的编译方法,如果想要转到Android Studio上编译的话还需要自己修改gradle文件。
  • Oculus Mobile SDK库。这个可以使预先编译好的,也可以是本机上重新编译生成的。强烈建议使用最新版本的
  • GearVRf示例程序。这个可要可不要,但可以从这些实例中上手。下面会以GearVRf-Demos中的eye-picking程序作为例子进行讲解。

在Android Studio上运行示例程序eye-picking

  • 将GearVRf-Demos压缩包中的eye-picking文件夹解压到本地路径。
  • 修改eye-picking文件夹中的project.properties文件。将第15行的代码注释掉。注释后的内容如下
# This file is automatically generated by Android Tools.# Do not modify this file -- YOUR CHANGES WILL BE ERASED!## This file must be checked in Version Control Systems.## To customize properties used by the Ant build system edit# "ant.properties", and override values to adapt the script to your# project structure.## To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt# Project target.target=android-19#android.library.reference.1=../../GearVRf/GVRf/Framework
  • 启动Android Studio,使用Import project导入eye-picking文件夹。
  • 导入结束后,打开转换后的工程。由于本身代码转换的问题,需要在app/src/res/values/strings.xml中添加代码。在
<string name="app_name">GVR Eyepicking Sample</string>

下添加

<string name="hello_world"></string><string name="action_settings"></string>
  • 在app下建立文件夹libs,将libs-gvrf.zip中的gvrf_exported.jar以及Oculus Mobile SDK中的VrApi.jar、VrAppFramework.jar、SystemUtils.jar复制进来。
  • 在app/src/main下建立文件夹jniLibs/armeabi-v7a,将libs-gvrf.zip中的libassimp.so、libgvrf.so以及Oculus Mobile SDK中的libvrapi.so、libvrappframework.a、libsystemutils.a复制进来。
  • 修改app/build.gradle。在最后添加上
dependencies {    compile files('libs/gvrf_exported.jar')    compile files('libs/SystemUtils.jar')    compile files('libs/VrApi.jar')    compile files('libs/VrAppFramework.jar')}
  • 对配置文件Sync完成后启动编译。切记把手机Oculus签名拷贝进app/src/main/assets。
0 0