Skip to content

Commit f9aa905

Browse files
author
di57mec
committed
work on 360 video
1 parent 113ca9c commit f9aa905

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//
2+
// Created by Consti10 on 28/09/2019.
3+
//
4+
5+
#include "SceneStereoscopic.h"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// Created by Consti10 on 28/09/2019.
3+
//
4+
5+
#ifndef FPV_VR_2018_SCENESTEREOSCOPIC_H
6+
#define FPV_VR_2018_SCENESTEREOSCOPIC_H
7+
8+
//TODO merge code for StereoNormal / StereoSupersync even more
9+
10+
class SceneStereoscopic {
11+
12+
};
13+
14+
15+
#endif //FPV_VR_2018_SCENESTEREOSCOPIC_H

app/src/main/cpp/Other/MatricesManager.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ void MatricesManager::calculateProjectionAndDefaultView360(float fov360Video,flo
3232
worldMatrices.projection360=glm::perspective(glm::radians(fov360Video), ratio, MIN_Z_DISTANCE, MAX_Z_DISTANCE);
3333
worldMatrices.monoViewTracked360=glm::mat4(1.0f);
3434
worldMatrices.monoForward360=glm::mat4(1.0f);
35-
worldMatrices.monoForward360 = glm::rotate(glm::mat4(1.0f),glm::radians(90.0f), glm::vec3(0,1,0)); //Default- rotate 90 around y axis
35+
//worldMatrices.monoForward360 = glm::rotate(glm::mat4(1.0f),glm::radians(90.0f), glm::vec3(0,0,-1)); //Default view direction, the gvr sphere is slightly different -
36+
//For 'normal'video its layout is fine, but for insta360 video the default view direction is wrong
3637
}
3738

3839
void MatricesManager::calculateNewHeadPoseIfNeeded(gvr::GvrApi *gvr_api, const int predictMS) {

app/src/main/cpp/Scene/Video/VideoRenderer.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,12 @@ void VideoRenderer::drawVideoCanvas360(glm::mat4x4 ViewM, glm::mat4x4 ProjM) {
120120
if(mMode!=VIDEO_RENDERING_MODE::RM_Degree360){
121121
throw "mMode!=VIDEO_RENDERING_MODE::Degree360";
122122
}
123+
//Default view direction, the gvr sphere is slightly different -
124+
//For 'normal'video its layout is fine, but for insta360 video the default view direction is wrong
125+
glm::mat4x4 modelMatrix=glm::rotate(glm::mat4(1.0F),glm::radians(90.0F), glm::vec3(0,0,-1));
126+
123127
mGLProgramSpherical->beforeDraw(mGLBuffSphereVertices);
124-
mGLProgramSpherical->draw(ViewM,ProjM,mSphere.getVertexCount());
128+
mGLProgramSpherical->draw(ViewM*modelMatrix,ProjM,mSphere.getVertexCount());
125129
mGLProgramSpherical->afterDraw();
126130
GLHelper::checkGlError("VideoRenderer::drawVideoCanvas360");
127131
}

0 commit comments

Comments
 (0)