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
package sample3d;
import javafx.application.Application;
import javafx.scene.paint.Color;
import my3d._shape3d;
import my3d._shape3d.*;
import my3d._viewer3d;
import my3d._viewport3d;
public class _sample02 extends _viewer3d {
public static void main(String... args) {
Application.launch(args);
}
private _shape3d box = _shape3d.create_box(1, 1, 1);
@Override
public void init_scene(_viewport3d vp) {
vp.set_light_balance(1, 0, 0);
int c = 1;
for (_face face : box.faces) {
face.set_color(new Color(c / 4, c % 4 / 2, c % 2, 1));
c++;
}
}
@Override
public void render(_viewport3d vp) {
vp.render_shape(box);
}
}