예제 #1
0
 private void setCurrentPositionMenuItem_Click(object sender, EventArgs e)
 {
     if (this.treeViewFrame.SelectedNode != null)
     {
         int index = this.treeViewFrame.SelectedNode.Index;
         CameraMotion.Frame motionFrame      = this.panelPreview.GetMotionFrame(index);
         Vector3            freeRoamPosition = this.panelPreview.GetFreeRoamPosition();
         Matrix             freeRoamMatrix   = this.panelPreview.GetFreeRoamMatrix();
         Vector3            lookAt           = freeRoamPosition - new Vector3(freeRoamMatrix.M13, freeRoamMatrix.M23, freeRoamMatrix.M33);
         Vector3            up = new Vector3(freeRoamMatrix.M12, freeRoamMatrix.M22, freeRoamMatrix.M32);
         up.Normalize();
         motionFrame.cameraPosition           = freeRoamPosition;
         motionFrame.LookAt                   = lookAt;
         motionFrame.Up                       = up;
         this.treeViewFrame.SelectedNode.Text = string.Format("Frame [{0}] : P[{1}] A[{2}] U[{3}]", new object[]
         {
             index,
             motionFrame.cameraPosition,
             motionFrame.LookAt,
             motionFrame.Up
         });
         this.panelPreview.UpdateCameraMatrices();
         this.camMotion.GenerateVertices();
     }
 }
예제 #2
0
 private void copyMenuItem_Click(object sender, EventArgs e)
 {
     if (this.treeViewFrame.SelectedNode != null)
     {
         int index = this.treeViewFrame.SelectedNode.Index;
         this.copiedFrame = this.panelPreview.GetMotionFrame(index);
     }
 }
예제 #3
0
        private void propertyGrid_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
        {
            int index = this.treeViewFrame.SelectedNode.Index;
            List <CameraMotion.Frame> frames = this.camMotion.GetFrames();

            CameraMotion.Frame frame = frames.ElementAt(index);
            this.treeViewFrame.SelectedNode.Text = string.Format("Frame [{0}] : P[{1}] A[{2}] U[{3}]", new object[]
            {
                index,
                frame.cameraPosition,
                frame.LookAt,
                frame.Up
            });
            this.panelPreview.UpdateCameraMatrices();
            this.camMotion.GenerateVertices();
        }
예제 #4
0
 private void addMenuItem_Click(object sender, EventArgs e)
 {
     if (this.treeViewFrame.SelectedNode != null)
     {
         AddFrameMessageBox addFrameMessageBox = new AddFrameMessageBox();
         if (addFrameMessageBox.ShowDialog() == DialogResult.OK)
         {
             int framePosition = addFrameMessageBox.GetFramePosition();
             int index         = this.treeViewFrame.SelectedNode.Index;
             CameraMotion.Frame motionFrame = this.panelPreview.GetMotionFrame(index);
             CameraMotion.Frame item        = new CameraMotion.Frame();
             item = motionFrame;
             List <CameraMotion.Frame> frames = this.camMotion.GetFrames();
             frames.Insert(index + framePosition, item);
             this.panelPreview.UpdateCameraMatrices();
             this.camMotion.GenerateVertices();
             this.DisplayFrames();
         }
     }
 }