Isometric drawing library for Android
isometricView.add(
new Prism(
new Point(/* x */ 0, /* y */ 0, /* z */ 0),
/* width */ 1, /* length */ 1, /* height */ 1
),
new Color(33, 150, 243)
);
There are 3 basic components: points, paths and shapes. A shape needs an origin point and 3 measurements for the x, y and z axes. The default Prism constructor is setting all measurements to 1.
isometricView.add(new Prism(new Point(0, 0, 0)), new Color(33, 150, 243));
isometricView.add(new Prism(new Point(-1, 1, 0), 1, 2, 1), new Color(33, 150, 243));
isometricView.add(new Prism(new Point(1, -1, 0), 2, 1, 1), new Color(33, 150, 243));
isometricView.add(new Prism(Point.ORIGIN, 3, 3, 1), new Color(50, 60, 160));
isometricView.add(new Path(new Point[]{
new Point(1, 1, 1),
new Point(2, 1, 1),
new Point(2, 2, 1),
new Point(1, 2, 1)
}), new Color(50, 160, 60));
compile 'io.fabianterhorst:Isometric:0.0.3'
Traslate is translating an point, path or shape to the given x, y and z distance. Translate is returning a new point, path or shape.
Prism prism = new Prism(new Point(0, 0, 0));
isometricView.add(prism, new Color(33, 150, 243));
isometricView.add(prism.translate(0, 0, 1.1), new Color(33, 150, 243));
Scale is scaling an point, path or shape with the given x, y and z scaling factors. Scale is returning a new point, path or shape.
Color blue = new Color(50, 60, 160);
Color red = new Color(160, 60, 50);
Prism cube = new Prism(Point.ORIGIN);
isometricView.add(cube.scale(Point.ORIGIN, 3.0, 3.0, 0.5), red);
isometricView.add(cube
.scale(Point.ORIGIN, 3.0, 3.0, 0.5)
.translate(0, 0, 0.6), blue);