我试图创建一个360图像查看器使用rajawali + vr (Cardboard工具包)。当我禁用CardboardView上的VR模式时,我在渲染器中对视图字段属性所做的更改没有任何影响。在Google 文档中,我发现视图将忽略它
对于单目渲染,实现者应该可以自由地忽略FieldOfView,而是创建一个透视图矩阵,其中包含用于单目渲染的任何视域。
我的问题是我该怎么做?我应该在哪里实现它,渲染器和CardboardView都没有设置perspectiveMatrix (float[])的方法。
发布于 2016-08-05 14:26:20
更新设备param似乎总是被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);
}
}https://stackoverflow.com/questions/38661630
复制相似问题