private void ButtonDefault_Click(object sender, RoutedEventArgs e) { //reset options //reset rotate angle OX_rotate.Value = 0; OY_rotate.Value = 0; OZ_rotate.Value = 0; //reset zoom OX_delatate.Value = 1; OY_delatate.Value = 1; OZ_delatate.Value = 1; //reset move OX_translate.Value = 0; OY_translate.Value = 0; OZ_translate.Value = 0; //reset mirror MirrorOX.IsChecked = false; MirrorOY.IsChecked = false; MirrorOZ.IsChecked = false; //delete dipyramid gr1.Children.Remove(dip); //create and add new dipyramid dip = new Dipyramid(); gr1.Children.Add(dip); dip.reDraw(); }
private void SliderOX_rotate_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) { Slider sl = (Slider)sender; //if (sl.Value < 0) //{ // dip.rotAngle.X = sliderXAngle_last_value - sl.Value; //} //else //{ // dip.rotAngle.X = sl.Value - sliderXAngle_last_value; //} //get angle for rotation about OX in radians, as the difference between current and previous value dip.rotAngle.X = sl.Value * Math.PI / 180 - sliderXAngle_last_value; dip.reDraw(); sliderXAngle_last_value = sl.Value * Math.PI / 180; }