Skip to content

Commit 25e464a

Browse files
committed
--add-opens in java_args.txt
1 parent f8f24e4 commit 25e464a

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed

contributed/data/java_args.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED --add-opens java.desktop/sun.java2d.opengl=ALL-UNNAMED

contributed/data/sutcliffe.png

-237 KB
Binary file not shown.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
load_library :hype
2+
%w[H HDrawablePool HSphere].freeze.each do |klass|
3+
java_import "hype.#{klass}"
4+
end
5+
java_import 'hype.extended.colorist.HColorField'
6+
java_import 'hype.extended.layout.HGridLayout'
7+
8+
attr_reader :color_field, :pool
9+
POOL_COLS = 9
10+
POOL_ROWS = 7
11+
POOL_DEPTH = 9
12+
13+
def settings
14+
size(640, 640, P3D)
15+
end
16+
17+
def setup
18+
sketch_title 'Color Field Example'
19+
H.init(self)
20+
H.background(color('#242424'))
21+
H.use3D(true)
22+
@color_field = HColorField.new(width, height)
23+
.add_point(-300, 0, color('#FF0066'), 0.6)
24+
.add_point(width - 300, 0, color('#3300FF'), 0.6)
25+
.fill_only
26+
# .strokeOnly
27+
# .fillAndStroke
28+
@pool = HDrawablePool.new(POOL_COLS * POOL_ROWS * POOL_DEPTH)
29+
pool.auto_add_to_stage
30+
.add(HSphere.new)
31+
.layout(HGridLayout.new.start_x(-600).start_y(-450).start_z(-600).spacing(150, 150, 150).rows(POOL_ROWS).cols(POOL_COLS))
32+
.on_create do |obj|
33+
obj.size(40).stroke_weight(0).no_stroke.fill(0).anchor_at(H::CENTER)
34+
end
35+
.requestAll
36+
end
37+
38+
def draw
39+
pool.each do |d|
40+
d.fill(0)
41+
color_field.apply_color(d)
42+
end
43+
lights
44+
sphere_detail(10)
45+
push_matrix
46+
translate(width / 2, height / 2, -800)
47+
rotate_y(frame_count.radians)
48+
H.draw_stage
49+
pop_matrix
50+
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED --add-opens java.desktop/sun.java2d.opengl=ALL-UNNAMED

0 commit comments

Comments
 (0)