コード例 #1
0
        private void WriteDataFrame(CsvFileWriter writer, HI5_TransformInstance hand, GestureType gesture)
        {
            List <string> frame = new List <string>();

            foreach (var t in hand.HandBones)
            {
                if (recordPositions)
                {
                    for (int i = 0; i < 3; i++)
                    {
                        frame.Add(t.localPosition[i].ToString());
                    }
                }
                for (int i = 0; i < 4; i++)
                {
                    frame.Add(t.localRotation[i].ToString());
                }
            }
            frame.Add(gesture.ToString());
            writer.WriteRow(frame);
            writer.Flush();
        }
コード例 #2
0
        private void WriteHeader(CsvFileWriter writer, HI5_TransformInstance hand)
        {
            List <string> header = new List <string>();

            string[] coords = { "X", "Y", "Z", "W" };
            foreach (var t in hand.HandBones)
            {
                if (recordPositions)
                {
                    for (int i = 0; i < 3; i++)
                    {
                        header.Add(string.Format("{0}_Pos_{1}", t.name, coords[i]));
                    }
                }
                for (int i = 0; i < 4; i++)
                {
                    header.Add(string.Format("{0}_Quat_{1}", t.name, coords[i]));
                }
            }
            header.Add("Gesture");
            writer.WriteRow(header);
            writer.Flush();
        }