public void AddFrame(CameraMotion.Frame frame) { if (this.motionFile != null) { this.motionFile.listChannel[0].normal.Add(frame.cameraPosition); this.motionFile.listChannel[1].normal.Add(frame.LookAt); this.motionFile.listChannel[2].normal.Add(frame.Up); this.motionFile.listChannel[3].normal.Add(new Vector3(0f, 0f, 0f)); this.motionFile.frameCount++; } }
public void ChangeFrame(CameraMotion.Frame newFrame, int indice) { this.motionFile.listChannel[0].normal[indice] = newFrame.cameraPosition; this.motionFile.listChannel[1].normal[indice] = newFrame.LookAt; this.motionFile.listChannel[2].normal[indice] = newFrame.Up; }
private void buttonOpenZMO_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "ZMO Files (*.ZMO)|*.ZMO"; openFileDialog.InitialDirectory = ContentManager.GetRootPath(); if (openFileDialog.ShowDialog() == DialogResult.OK) { this.camMotion = new CameraMotion(this.panelPreview.GraphicsDevice); this.camMotion.Load(openFileDialog.FileName, ClientType.IROSE); this.labelMotionName.Text = "Motion name : " + openFileDialog.SafeFileName; this.numericUpDownFPS.Value = this.camMotion.GetFPS(); this.panelPreview.SetCameraMotion(this.camMotion); this.DisplayFrames(); this.frameContextMenuStrip.Enabled = true; this.addMenuItem.Enabled = true; this.removeMenuItem.Enabled = true; this.setCurrentPositionMenuItem.Enabled = true; this.copyMenuItem.Enabled = true; this.pasteMenuItem.Enabled = true; this.interpolationMenuItem.Enabled = true; } }
private void buttonNewZMO_Click(object sender, EventArgs e) { SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "ZMO Files (*.ZMO)|*.ZMO"; saveFileDialog.AddExtension = true; if (saveFileDialog.ShowDialog() == DialogResult.OK) { this.camMotion = new CameraMotion(this.panelPreview.GraphicsDevice); List<CameraMotion.Frame> frames = this.camMotion.GetFrames(); for (int i = 0; i < 5; i++) { frames.Add(new CameraMotion.Frame { cameraPosition = new Vector3(5200f, 5200f, 20f), LookAt = new Vector3(5200f, 5201f, 20f), Up = new Vector3(0f, 1f, 0f) }); } this.camMotion.motionFile = new ZMO(); this.numericUpDownFPS.Value = 30m; this.camMotion.motionFile.FPS = 30; this.camMotion.motionFile.Path = saveFileDialog.FileName; this.camMotion.GenerateVertices(); this.camMotion.GenerateViewMatrices(); this.panelPreview.SetCameraMotion(this.camMotion); this.DisplayFrames(); this.labelMotionName.Text = "Motion name : " + saveFileDialog.FileName; this.frameContextMenuStrip.Enabled = true; this.addMenuItem.Enabled = true; this.removeMenuItem.Enabled = true; this.setCurrentPositionMenuItem.Enabled = true; this.copyMenuItem.Enabled = true; this.pasteMenuItem.Enabled = true; this.interpolationMenuItem.Enabled = true; } }