Closed AppWerft closed 6 years ago
The core problem is that many developers wanted slightly different functionality for mixing custom yaw/pitch config and gyro-based config and there was no way to support all of them.
Instead we created the video360 sample which demonstrates creating a custom 360 viewer which whatever functionality you need. See #510 for more info.
G
V
Hi, I'm using the vr360 project, how would you rotate the mesh from VrVideoActivity? @sigmaxipi
I tried with gvrView.setRotationY(45)
but it rotates the View .-. and not the sphere
Mesh.glDraw
takes in a model-view-projection matrix but SceneRenderer.glDrawFrame
only passes in a view-projection matrix since there was no need for a rotation matrix in this sample. You'll need to add a rotation matrix in either of those two functions. Reticle.glDrawFrame
shows how to take in a view-projection matrix & rotation matrix to update the reticle. You'll want to replicate this for Mesh
.
Uh cool, will try to implement ASAP and will post back. But wouldn't it be better to change directly the viewProjectionMatrix / sensor data like in the MonoscopicView? @sigmaxipi
For the moment implemented the rotation inside VrVideoActivity.java within onDrawEye
function.
Probably not the best performance wise but works, maybe later on will search for a better solution.
Of course if you already have better implementions, maybe share them 😁
@Override
public void onDrawEye(Eye eye) {
Matrix.multiplyMM(viewProjectionMatrix, 0, eye.getPerspective(Z_NEAR, Z_FAR), 0, eye.getEyeView(), 0);
Matrix.rotateM(viewProjectionMatrix, 0, my_offset_value, 0, 1, 0);
scene.glDrawFrame(viewProjectionMatrix, eye.getType());
}
If you changed the viewProjectionMatrix, you would end up rotating the world and not the mesh. This is OK for MonoscopicView where the only item in the world is the mesh, but wouldn't be the proper way of doing it for a more complicated GL scene.
Yeah, you got a point. Luckily this is exactly what I need for the moment 👍 Will surely take it consideration for future developments, thanks sigmaxipi!
This issue (https://github.com/googlevr/gvr-android-sdk/issues/334) is two years old. And I don't understand Google and the VR-team. Of course we need a possibility to control the yaw/headrotation. I see more then one solutions:
We build a touristic AR app and now we say to user: please rotate and if the heading is equal a value we start the VRView, this cannot be the solution!
This Titanium app uses this module: https://github.com/AppWerft/Ti.VRView