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); }
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); } } }
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); }
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); }
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(); }
public abstract Object Transform(RotateStruct turnKoefs, ScaleStruct scaleKoefs, MoveStruct moveKoefs);