[英]How to determine [x,y,z] coordinate of PalmPosition for hand?
HandList hands = frame.Hands;
Hand h = hands[0];
Vector pp = h.PalmPosition;
sw.WriteLine(String.Format("{0:f4}, {0:f4}, {0:f4}", pp.x, pp.y, pp.z));
對於此代碼,我對x,y和z的輸出始終相同。 如果我繞循環圈運動,則x,y,z坐標始終相同,這是不希望的。
如何獲得Palm的x,y,z坐標?
您似乎要打印pp.x
3次,而從未使用其他2個變量,因為{0:f4}
的零指定格式字符串本身之后的第一個參數pp.x
string h = "Hello";
string w = "World!";
Console.WriteLine("{0} {1}, it is {2}.", h, w, DateTime.Now);
這個愚蠢的例子應該更清楚。 還要注意, Console.WriteLine
這種重載格式像string.Format
一樣格式化文本。 更多信息在這里 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.