protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { double delta = 0.3; switch (keyData) { case Keys.W: camera.Position *= Transformations.Translate(0.1 * camera.Forward); break; case Keys.A: camera.Position *= Transformations.Translate(0.1 * camera.Left); break; case Keys.S: camera.Position *= Transformations.Translate(0.1 * camera.Backward); break; case Keys.D: camera.Position *= Transformations.Translate(0.1 * camera.Right); break; case Keys.Left: camera.AngleY += delta; break; case Keys.Right: camera.AngleY -= delta; break; case Keys.Up: camera.AngleX += delta; break; case Keys.Down: camera.AngleX -= delta; break; } sceneView1.Refresh(); return(base.ProcessCmdKey(ref msg, keyData)); }
private void Translate() { double translatingX = (double)numericUpDown7.Value; double translatingY = (double)numericUpDown8.Value; double translatingZ = (double)numericUpDown9.Value; CurrentDrawable.Apply(Transformations.Translate(translatingX, translatingY, translatingZ)); sceneView1.Refresh(); }