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
36
37
38
39
40
41
package sample3d;
import javafx.application.Application;
import javafx.scene.paint.Color;
import my3d._math3d.*;
import my3d._shape3d;
import my3d._slider_dialog.*;
import my3d._viewer3d5;
import my3d._viewport3d;
import my3d._viewport3d3;
public class _sample11 extends _viewer3d5 {
public static void main(String... args) {
Application.launch(args);
}
private _shape3d box, ball;
@Override
public void init_scene(_viewport3d vp) {
set_animation_enable(true);
_viewport3d3 vp3 = (_viewport3d3)vp;
vp3.set_zbuffer_enable(true);
_slider.set_tick_response(true);
box = _shape3d.create_box(1, 1, 1);
ball = _shape3d.create_ball(1, 5);
ball.set_color(Color.RED);
}
private _transform tf = new _transform();
@Override
public void render(_viewport3d vp) {
vp.render_shape(box);
_matrix.scale(get_anim_pos() + 1, tf.orientation);
vp.push_transform(tf);
vp.render_shape(ball);
}
}