簡體   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