我對Unity 3D和C#有點新鮮。另外我不完全確定如何Kudans任意跟蹤解決方案詳細工作。我目前正在使用Unity Kudan SDK來構建VR位置跟蹤解決方案,至少我會嘗試它。現在我的計劃是:Unity 3D Kudan「放置無標記物體」每當網格離開屏幕?
- 每當網格離開屏幕,我想凍結it's位置,並尋找新的特徵點(以下簡稱「地方無標記對象」按鈕是這樣做的:尋找新的功能點和地點一個網格)。
- 一旦它找到新的特徵點(應該是毫秒級的),它會解除網格的位置並使用新的特徵點來進一步改變它的位置。
「找到新的特徵點」的想法是必要的,因爲無論何時網格和舊特徵點離開屏幕,跟蹤將變得非常不準確。
我已經嘗試過這SampleApp.cs:
bool VRSignal;
public void Start()
{
//Get Bools from "KudanTracker"
GameObject g = GameObject.Find("Kudan Camera");
KudanTracker bScript = g.GetComponent<KudanTracker>();
bool VRSignal = bScript.ArbiTrackIsTracking();
}
public void Update()
{
if(VRSignal == false)
{
// from the floor placer.
Vector3 floorPosition; // The current position in 3D space of the floor
Quaternion floorOrientation; // The current orientation of the floor in 3D space, relative to the device
_kudanTracker.FloorPlaceGetPose(out floorPosition, out floorOrientation); // Gets the position and orientation of the floor and assigns the referenced Vector3 and Quaternion those values
_kudanTracker.ArbiTrackStart(floorPosition, floorOrientation); \t \t \t \t // Starts markerless tracking based upon the given floor position and orientations
}
}
但現在它不需額外的軌道正確地跟蹤了,還i'm很肯定ArbiTrackIsTracking()不會致使是解決方案是因爲它在網格離開屏幕時不會失去跟蹤。
你有什麼想法來解決這個問題嗎?
如果你想知道網格何時離開屏幕,可能值得檢查___ Renderer.isVisible ___。從理論上講,一旦它離開照相機視圖,就會出於性能目的自動剔除它,此時它不再被視爲可見。此時,您的代碼將運行。我認爲這會解決你的問題。 請注意,當使用___ Renderer.isVisible ___時,如果您出於任何原因開始使用陰影,則可能會遇到問題,即即使在屏幕外用於呈現陰影的目的,對象仍然被視爲可見。 – DisturbedNeo