1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
package sample3d; import javafx.application.Application; import my3d._math3d.*; import my3d._shape3d; import my3d._viewer3d4; import my3d._viewport3d; import my3d._viewport3d2; public class _sample07 extends _viewer3d4 { public static void main(String... args) { Application.launch(args); } private _shape3d box = _shape3d.create_box(0.3, 0.3, 0.3); private _transform[] tf_list = new _transform[9]; @Override public void init_scene(_viewport3d vp) { ((_viewport3d2)vp).set_zsort_enable(true); for (int i = 0; i < 9; i++) tf_list[i] = new _transform(new _vector(i % 3 - 1, 0, i / 3 - 1)); } @Override public void render(_viewport3d vp) { for (_transform tf : tf_list) { vp.push_transform(tf); vp.render_shape(box); vp.pop_transform(); } } }