Example #1
0
 private void MoveModel(MoveStruct moveKoefs)
 {
     foreach (Polygon pol in polygons)
     {
         foreach (PointInt v in pol.GetPointInts())
         {
             Moving.MovePoint(ref v.x, ref v.y, ref v.z, moveKoefs);
         }
     }
 }
Example #2
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);
        }
Example #3
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();
        }
Example #4
0
 public static void MovePoint(ref int x, ref int y, ref int z, MoveStruct moveKoefs)
 {
     x += moveKoefs.dx;
     y += moveKoefs.dy;
     z += moveKoefs.dz;
 }
Example #5
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);
        }
Example #6
0
 public abstract Object Transform(RotateStruct turnKoefs, ScaleStruct scaleKoefs, MoveStruct moveKoefs);