2013-04-12 53 views
3

我將JPCT-AE與Vuforia集成爲Vuforia樣本ImageTarget茶壺模型。我跟着凱爾瑪和薩姆拉德的answer現在我能夠呈現我的模型以及茶壺,但只在橫向模式。將JPCT-AE與Vuforia集成

:::::但:::::::

當我ImageTarget做出改變initApplication()

int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR; 
             or ORIENTATION_PORTRATE; 

我的模型開始在這裏和那裏渲染,這意味着在屏幕上它不是茶壺被渲染的方式。據我所知,我們需要改變矩陣的東西,以肖像模式呈現模型。

但我不知道如何。如果您有任何想法,請儘快轉介給我。

回答

0

這是Vuforia示例代碼報價:

Set the screen orientation 
     // 
     // NOTE: It is recommended to set this because of the following reasons: 
     // 
     // 1.) Before Android 2.2 there is no reliable way to query the 
     //  absolute screen orientation from an activity, therefore using 
     //  an undefined orientation is not recommended. Screen 
     //  orientation matching orientation sensor measurements is also 
     //  not recommended as every screen orientation change triggers 
     //  deinitialization/(re)initialization steps in internal QCAR 
     //  SDK components resulting in unnecessary overhead during 
     //  application run-time. 
     // 
     // 2.) Android camera drivers seem to always deliver landscape images 
     //  thus QCAR SDK components (e.g. camera capturing) need to know 
     //  when we are in portrait mode. Before Android 2.2 there is no 
     //  standard, device-independent way to let the camera driver know 
     //  that we are in portrait mode as each device seems to require a 
     //  different combination of settings to rotate camera preview 
     //  frames images to match portrait mode views. Because of this, 
     //  we suggest that the activity using the QCAR SDK be locked 
     //  to landscape mode if you plan to support Android 2.1 devices 
     //  as well. Froyo is fine with both orientations. 

我已經在Changing Screen.orientation at Runtime該屏幕的高度和寬度,如果您切換方向不改變讀取。它們與默認方向保持一致,導致格式錯誤跟蹤。

就我個人而言,如果您改變方向,我認爲您不會得到好的結果,但爲了確保您可以從Vuforia support詢問。球隊。自己檢查屏幕高度和寬度是否在方向轉換過程中發生變化。如果是這樣,你可以創建你的FrameBuffer與我相信將解決您的問題的新值。

+0

感謝您的回覆,我明白了。當我問vuforia主持人AlessandroB時,他也回答:Vuforia軸系統在橫向模式下以某種方式定義。並告訴交換X和Y軸並將其設置在JPCT相機對象中。但我不明白我會在哪裏得到軸,我不得不設置。如果你做到了,那麼請告訴我一些線索。這是vuforia交通技術鏈接... https://developer.vuforia.com/forum/android/integrating-jpct-ae-vuforia – ashunkhs

+0

@ashunkhs,對不起,我沒有這樣做,因爲我並不需要肖像模式。爲什麼你甚至需要肖像?你有什麼打算? –

+0

其實我的應用程序是在肖像模式。我無法更改其UI設計。所以我需要改變它作爲我的應用程序。 – ashunkhs