2017-04-25 335 views
7

我正在開發一個結合了Vuforia ImageTarget和VideoPlayback的項目。我有'N'個目標,並且有相應的視頻。對於某些imageTargets,視頻會翻轉。我找不到解決此問題的方法。這裏是我的VideoPlaybackRendererVuforia Videoplayback問題 - 正在播放視頻

int videoPlaybackTextureID[] = new int[VideoPlayback.NUM_TARGETS]; 

// Keyframe and icon rendering specific 
private int keyframeShaderID = 0; 
private int keyframeVertexHandle = 0; 
private int keyframeNormalHandle = 0; 
private int keyframeTexCoordHandle = 0; 
private int keyframeMVPMatrixHandle = 0; 
private int keyframeTexSampler2DHandle = 0; 

// We cannot use the default texture coordinates of the quad since these 
// will change depending on the video itself 
private float videoQuadTextureCoords[] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, }; 


private Float videoQuadTextureCoordsTransformed[] = {0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f,}; 


List<Float[]> videoQuadTextureCoordsTransformedList = new ArrayList<Float[]>(); 


// Trackable dimensions 
Vec3F targetPositiveDimensions[] = new Vec3F[VideoPlayback.NUM_TARGETS]; 
+0

什麼是每個'ImageTarget'的您正在使用的'Transform'旋轉?我的意思是他們都設置爲(0,0,0)? – Hristo

+0

@Hristo對不起..我沒有得到你..! – gStephin

+0

當你在Unity中,你從_Hierarchy_中選擇一個'ImageTargets',然後看看_Inspector_選項卡,'Transform' ** rotation **的值是什麼? – Hristo

回答

4

看起來像你需要選擇對象的視頻,然後應用這樣的事:例如 您選擇的立方體。

這將旋轉立方體180度,而無需修改任何其他旋轉軸

cube.transform.rotation = new Quaternion(cube.transform.rotation.x, cube.transform.rotation.y, cube.transform.rotation.z, 180);