3

I am trying to create a 360 image viewer using rajawali + vr (Cardboard toolkit). When i disable the VR-Mode on the CardboardView the changes i made on Field of View property in the renderer has no effect. in the Google Cardboard docs i found the the view will ignore it

For monocular rendering, the implementor should feel free to ignore the FieldOfView and instead create a perspective matrix with whatever field of view is desired for monocular rendering

My Question is how can i do this? and where should i implement it, neither the renderer nor the CardboardView has a method to set an perspectiveMatrix (float[])?

Keiner
  • 31
  • 3
  • Keiner did u get ur solution. Actually i am also finding such solution. – Krunal Indrodiya Sep 15 '16 at 10:40
  • @KrunalIndrodiya Actually not. I have switch to this [framework](http://www.panframe.com/) but if you have an link where to your solution or an hint I would appreciate. – Keiner Sep 15 '16 at 10:53
  • Thanks for replay,Actually i am also looking for panorama viewer in android, which display panorama image in 360. And i have to control over Panorama speed and other thing also. Google have library to for that, but not able to do anything. So, the question is that panframe does support panorama image 360? – Krunal Indrodiya Sep 15 '16 at 12:25
  • first of all panframe is not free, second it is limited in controls and at least it has it's bugs too. So i think it´s not a real solution – Keiner Sep 15 '16 at 13:08
  • Thanks. Do u have any idea about other framework. And do u have panframe link, so can i download it. – Krunal Indrodiya Sep 15 '16 at 13:10
  • it´s linked in my comment above. all others frameworks i found are crap and/or outdated – Keiner Sep 15 '16 at 13:17
  • Thanks for support. – Krunal Indrodiya Sep 15 '16 at 13:24

1 Answers1

1

updating the device param seems to always get overwritten by the gvr view

but if you decompile the FieldOfView class, you get this:

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);
    }
}