예제 #1
0
        public override void BeforeAction(ThreeDModel model)
        {
            double t = Time;
            Vector3 c = model.getCenter();
            //c = Vector3.Add(c,new Vector3(model.Position.x, model.Position.y, model.Position.z));
            if (mode == 0)
            {
                height = Main.printerSettings.PrintAreaHeight * 1.2;
                mode = 1;
            }
            if (t < 1)
            {
                // s = 0,5*a*t^2
                // land after 1.5 sec =>a = 2*s/2.25

                GL.Translate(0, 0, height - 1.0 / 1.0 * height * t * t);
            }
            else if (t < 1.25)
            {
                double zamp = 0.3 * c.Z * (t - 1.25) / 0.25;
                GL.Translate(c.X,c.Y,c.Z-zamp);
                GL.Scale(1.0 + zamp/c.Z, 1.0 + zamp/c.Z, 1.0 - zamp/c.Z);
                GL.Translate(-c.X, -c.Y, -c.Z);
            }
            else if (t < 1.5)
            {
                double zamp = 0.3 * c.Z * (1.5-t) / 0.25;
                GL.Translate(c.X, c.Y, c.Z - zamp);
                GL.Scale(1.0 + zamp / c.Z, 1.0 + zamp / c.Z, 1.0 - zamp / c.Z);
                GL.Translate(-c.X, -c.Y, -c.Z);
            }
            else mode = 2;
        }
예제 #2
0
        public override void BeforeAction(ThreeDModel model)
        {
            double  baseamp = Math.Sin(Time * 2.0 * Math.PI * frequency);
            Vector3 center  = model.getCenter();

            //center = Vector3.Add(center,new Vector3(model.Position.x,model.Position.y,model.Position.z));
            GL.Translate(center);
            GL.Scale(1.0 + scalex * baseamp, 1.0 + scaley * baseamp, 1.0 + scalez * baseamp);
            GL.Translate(-center.X, -center.Y, -center.Z);
        }
예제 #3
0
        public override void BeforeAction(ThreeDModel model)
        {
            double  t = Time;
            Vector3 c = model.getCenter();

            //c = Vector3.Add(c,new Vector3(model.Position.x, model.Position.y, model.Position.z));
            if (mode == 0)
            {
                height = Main.printerSettings.PrintAreaHeight * 1.2;
                mode   = 1;
            }
            if (t < 1)
            {
                // s = 0,5*a*t^2
                // land after 1.5 sec =>a = 2*s/2.25

                GL.Translate(0, 0, height - 1.0 / 1.0 * height * t * t);
            }
            else if (t < 1.25)
            {
                double zamp = 0.3 * c.Z * (t - 1.25) / 0.25;
                GL.Translate(c.X, c.Y, c.Z - zamp);
                GL.Scale(1.0 + zamp / c.Z, 1.0 + zamp / c.Z, 1.0 - zamp / c.Z);
                GL.Translate(-c.X, -c.Y, -c.Z);
            }
            else if (t < 1.5)
            {
                double zamp = 0.3 * c.Z * (1.5 - t) / 0.25;
                GL.Translate(c.X, c.Y, c.Z - zamp);
                GL.Scale(1.0 + zamp / c.Z, 1.0 + zamp / c.Z, 1.0 - zamp / c.Z);
                GL.Translate(-c.X, -c.Y, -c.Z);
            }
            else
            {
                mode = 2;
            }
        }
예제 #4
0
 private void objectSelected(ThreeDModel sel)
 {
     if (Control.ModifierKeys == Keys.Shift)
     {
         if (!sel.Selected)
             listSTLObjects.SelectedItems.Add(sel);
     }
     else
         if (Control.ModifierKeys == Keys.Control)
         {
             if (sel.Selected)
                 listSTLObjects.SelectedItems.Remove(sel);
             else
                 listSTLObjects.SelectedItems.Add(sel);
         }
         else
         {
             listSTLObjects.SelectedItems.Clear();
             listSTLObjects.SelectedItem = sel;
         }
 }
예제 #5
0
 public virtual void AfterAction(ThreeDModel model)
 {
 }
예제 #6
0
 public virtual void BeforeAction(ThreeDModel model)
 {
 }
예제 #7
0
 public virtual void BeforeAction(ThreeDModel model)
 {
 }
예제 #8
0
 public virtual void AfterAction(ThreeDModel model)
 {
 }
예제 #9
0
 public override void BeforeAction(ThreeDModel model)
 {
     double baseamp = Math.Sin(Time * 2.0 * Math.PI * frequency);
     Vector3 center = model.getCenter();
     //center = Vector3.Add(center,new Vector3(model.Position.x,model.Position.y,model.Position.z));
     GL.Translate(center);
     GL.Scale(1.0 + scalex * baseamp, 1.0 + scaley * baseamp, 1.0 + scalez * baseamp);
     GL.Translate(-center.X, -center.Y, -center.Z);
 }