Exemplo n.º 1
0
        public static void ScalePoint(ref int x, ref int y, ref int z, ScaleStruct koefs)
        {
            double x_tmp = x;
            double y_tmp = y;
            double z_tmp = z;

            x = (int)(x_tmp * koefs.kx);
            y = (int)(y_tmp * koefs.ky);
            z = (int)(z_tmp * koefs.kz);
        }
Exemplo n.º 2
0
 private void ScaleModel(ScaleStruct scaleKoefs)
 {
     foreach (Polygon pol in polygons)
     {
         foreach (PointInt v in pol.GetPointInts())
         {
             Scaling.ScalePoint(ref v.x, ref v.y, ref v.z, scaleKoefs);
         }
     }
 }
Exemplo n.º 3
0
        public Scene GetTransformed(RotateStruct turnKoefs, ScaleStruct scaleKoefs, MoveStruct moveKoefs)
        {
            Scene s = new Scene(size);

            foreach (Object obj in scene)
            {
                s.AddModel(obj.Transform(turnKoefs, scaleKoefs, moveKoefs));
            }

            return(s);
        }
Exemplo n.º 4
0
        public override Object Transform(RotateStruct turnKoefs, ScaleStruct scaleKoefs, MoveStruct moveKoefs)
        {
            Map   newMap = new Map(map);
            Shape shape  = new Shape(newMap, col, dh);

            shape.TurnModel(turnKoefs);
            shape.ScaleModel(scaleKoefs);
            shape.MoveModel(moveKoefs);

            return(shape);
        }
Exemplo n.º 5
0
        private void CreateScene_Click(object sender, EventArgs e)
        {
            turnKoefs  = new RotateStruct(-90, 0, 0);
            scaleKoefs = new ScaleStruct(1.25, 1.25, 1.25);
            moveKoefs  = new MoveStruct(canvas.Width / 2, canvas.Height / 2 - 150, 0);

            scene = new Scene(canvas.Size);
            CreateCloud();
            if (CheckGenGround.Checked)
            {
                CreateGround();
            }
            SetSun();
            HandleSceneChange();
        }
Exemplo n.º 6
0
 public abstract Object Transform(RotateStruct turnKoefs, ScaleStruct scaleKoefs, MoveStruct moveKoefs);