public void Visit(Box3D box) { Shape3DComposite composite = new Shape3DComposite(); composite.CoordinateSystem = box.CoordinateSystem; float dx = box.Width / 2; float dy = box.Height / 2; float dz = box.Depth / 2; var top = new Rectangle3D { A = new Vector3D(-dx, -dy, -dz), B = new Vector3D(-dx, -dy, +dz), C = new Vector3D(+dx, -dy, -dz), Material = box.Material }; var bottom = new Rectangle3D { A = new Vector3D(-dx, +dy, -dz), B = new Vector3D(-dx, +dy, +dz), C = new Vector3D(+dx, +dy, -dz), Material = box.Material }; var left = new Rectangle3D { A = new Vector3D(-dx, -dy, -dz), B = new Vector3D(-dx, +dy, -dz), C = new Vector3D(-dx, -dy, +dz), Material = box.Material }; var right = new Rectangle3D { A = new Vector3D(+dx, -dy, -dz), B = new Vector3D(+dx, +dy, -dz), C = new Vector3D(+dx, -dy, +dz), Material = box.Material }; var front = new Rectangle3D { A = new Vector3D(-dx, -dy, -dz), B = new Vector3D(-dx, +dy, -dz), C = new Vector3D(+dx, -dy, -dz), Material = box.Material }; var back = new Rectangle3D { A = new Vector3D(-dx, -dy, +dz), B = new Vector3D(-dx, +dy, +dz), C = new Vector3D(+dx, -dy, +dz), Material = box.Material }; composite.Add(top); composite.Add(bottom); composite.Add(left); composite.Add(right); composite.Add(front); composite.Add(back); Visit(composite); }
public SensitiveMatrix(Canvas canvas) : base(null) { this.canvas = canvas; Rectangle3D origin = new Rectangle3D(); // TODO: set rectangle's params //rectangle = new RERectangle(origin); }
public void Visit(Rectangle3D rect) { var globalRectangle = new Rectangle3D { A = ToAbsolute(rect.A), B = ToAbsolute(rect.B), C = ToAbsolute(rect.C), Material = rect.Material }; _decoratedShape = new RERectangle(globalRectangle); }
public RERectangle(Rectangle3D rect) : base(rect, rect.A, rect.B - rect.A, rect.C - rect.A) { }