예제 #1
0
 public void Save()
 {
     string path = this.motionFile.Path;
     this.motionFile = new ZMO();
     this.motionFile.channelCount = 4;
     this.motionFile.listChannel = new List<ZMO.Channel>(4);
     this.motionFile.FPS = 30;
     this.motionFile.frameCount = this.frameList.Count;
     for (int i = 0; i < 4; i++)
     {
         this.motionFile.listChannel.Add(new ZMO.Channel
         {
             trackType = ZMO.TrackType.TRACK_TYPE_POSITION,
             trackID = i,
             position = new List<Vector3>(this.frameList.Count)
         });
     }
     for (int i = 0; i < 4; i++)
     {
         for (int j = 0; j < this.frameList.Count; j++)
         {
             if (i == 0)
             {
                 this.motionFile.listChannel[i].position.Add((this.frameList[j].cameraPosition - CameraMotion.realPosition) * 100f);
             }
             else if (i == 1)
             {
                 this.motionFile.listChannel[i].position.Add((this.frameList[j].LookAt - CameraMotion.realPosition) * 100f);
             }
             else if (i == 2)
             {
                 this.motionFile.listChannel[i].position.Add(this.frameList[j].Up * 100f);
             }
             else if (i == 3)
             {
                 this.motionFile.listChannel[i].position.Add(new Vector3(45f, 100f, 130000f));
             }
         }
     }
     this.motionFile.Save(path);
 }
예제 #2
0
 public void Load(string mypath, ClientType myclientType)
 {
     this.motionFile = new ZMO();
     this.motionFile.Load(mypath, myclientType);
     if (!this.motionFile.IsCameraMotion())
     {
         throw new Exception("This ZMO isn't a cameraMotion");
     }
     this.GenerateFrames();
     this.GenerateViewMatrices();
     this.GenerateVertices();
 }