繁体   English   中英

360全景查看器与rajawali + VR如何改变FieldOfView

[英]360 panorama viewer with rajawali + VR howto change FieldOfView

我正在尝试使用rajawali + vr(Cardboard toolkit)创建360图像查看器。 当我在CardboardView上禁用VR模式时,我在渲染器中对Field of View属性所做的更改无效。 在Google Cardboard 文档中,我发现该视图将忽略它

对于单眼渲染,实现者应该随意忽略FieldOfView,而是创建一个透视矩阵,其中单眼渲染需要任何视野。

我的问题是我该怎么做? 我应该在哪里实现它,渲染器和CardboardView都没有设置perspectiveMatrix(float [])的方法?

更新设备参数似乎总是被gvr视图覆盖

但如果你反编译FieldOfView类,你得到这个:

public void toPerspectiveMatrix(float near, float far, float[] perspective, int offset) {
    if(offset + 16 > perspective.length) {
        throw new IllegalArgumentException("Not enough space to write the result");
    } else {
        float l = (float)(-Math.tan(Math.toRadians((double)this.left))) * near;
        float r = (float)Math.tan(Math.toRadians((double)this.right)) * near;
        float b = (float)(-Math.tan(Math.toRadians((double)this.bottom))) * near;
        float t = (float)Math.tan(Math.toRadians((double)this.top)) * near;
        Matrix.frustumM(perspective, offset, l, r, b, t, near, far);
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM