File tree Expand file tree Collapse file tree 4 files changed +39
-35
lines changed
external_library/java/PixelFlow
processing_app/topics/lsystems Expand file tree Collapse file tree 4 files changed +39
-35
lines changed Original file line number Diff line number Diff line change @@ -100,8 +100,7 @@ def display_mesh(ifs)
100100
101101def create_gizmo ( s )
102102 stroke_weight ( 1 )
103- shp_gizmo = create_shape
104- shp_gizmo . tap do |shp |
103+ create_shape . tap do |shp |
105104 shp . begin_shape ( LINES )
106105 shp . stroke ( 255 , 0 , 0 )
107106 shp . vertex ( 0 , 0 , 0 )
Original file line number Diff line number Diff line change @@ -38,21 +38,24 @@ def add_shape(position, scale)
3838 shp_samples . add_child ( shp_point )
3939end
4040
41- def display_gizmo ( s )
42- if ( shp_gizmo . nil? )
43- stroke_weight ( 1 )
44- @shp_gizmo = create_shape
45- shp_gizmo . begin_shape ( LINES )
46- shp_gizmo . stroke ( 255 , 0 , 0 )
47- shp_gizmo . vertex ( 0 , 0 , 0 )
48- shp_gizmo . vertex ( s , 0 , 0 )
49- shp_gizmo . stroke ( 0 , 255 , 0 )
50- shp_gizmo . vertex ( 0 , 0 , 0 )
51- shp_gizmo . vertex ( 0 , s , 0 )
52- shp_gizmo . stroke ( 0 , 0 , 255 )
53- shp_gizmo . vertex ( 0 , 0 , 0 )
54- shp_gizmo . vertex ( 0 , 0 , s )
55- shp_gizmo . end_shape
41+ def create_gizmo ( s )
42+ stroke_weight ( 1 )
43+ create_shape . tap do |shp |
44+ shp . begin_shape ( LINES )
45+ shp . stroke ( 255 , 0 , 0 )
46+ shp . vertex ( 0 , 0 , 0 )
47+ shp . vertex ( s , 0 , 0 )
48+ shp . stroke ( 0 , 255 , 0 )
49+ shp . vertex ( 0 , 0 , 0 )
50+ shp . vertex ( 0 , s , 0 )
51+ shp . stroke ( 0 , 0 , 255 )
52+ shp . vertex ( 0 , 0 , 0 )
53+ shp . vertex ( 0 , 0 , s )
54+ shp . end_shape
5655 end
56+ end
57+
58+ def display_gizmo ( s )
59+ @shp_gizmo = create_gizmo ( s ) unless shp_gizmo
5760 shape ( shp_gizmo )
5861end
Original file line number Diff line number Diff line change @@ -113,23 +113,26 @@ def add_shape(sample)
113113 # shp_samples_spheres.addChild(shp_sphere_normals)
114114end
115115
116- def display_gizmo ( s )
117- if shp_gizmo . nil?
118- stroke_weight ( 1 )
119- @shp_gizmo = create_shape
120- shp_gizmo . begin_shape ( LINES )
121- shp_gizmo . stroke ( 255 , 0 , 0 )
122- shp_gizmo . vertex ( 0 , 0 , 0 )
123- shp_gizmo . vertex ( s , 0 , 0 )
124- shp_gizmo . stroke ( 0 , 255 , 0 )
125- shp_gizmo . vertex ( 0 , 0 , 0 )
126- shp_gizmo . vertex ( 0 , s , 0 )
127- shp_gizmo . stroke ( 0 , 0 , 255 )
128- shp_gizmo . vertex ( 0 , 0 , 0 )
129- shp_gizmo . vertex ( 0 , 0 , s )
130- shp_gizmo . end_shape
116+ def create_gizmo ( s )
117+ stroke_weight ( 1 )
118+ create_shape . tap do |shp |
119+ shp . begin_shape ( LINES )
120+ shp . stroke ( 255 , 0 , 0 )
121+ shp . vertex ( 0 , 0 , 0 )
122+ shp . vertex ( s , 0 , 0 )
123+ shp . stroke ( 0 , 255 , 0 )
124+ shp . vertex ( 0 , 0 , 0 )
125+ shp . vertex ( 0 , s , 0 )
126+ shp . stroke ( 0 , 0 , 255 )
127+ shp . vertex ( 0 , 0 , 0 )
128+ shp . vertex ( 0 , 0 , s )
129+ shp . end_shape
131130 end
132- shape shp_gizmo
131+ end
132+
133+ def display_gizmo ( s )
134+ @shp_gizmo = create_gizmo ( s ) unless shp_gizmo
135+ shape ( shp_gizmo )
133136end
134137
135138def key_released
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ def initialize
1616 @axiom = 'F-F-F-F-F'
1717 @grammar = Grammar . new ( axiom , 'F' => 'F+F+F-F-F-F+F+F' )
1818 @draw_length = 400
19- @theta = 0.0
19+ @theta = 0
2020 @xpos = 0.0
2121 @ypos = 0.0
2222 end
@@ -100,4 +100,3 @@ def key_pressed
100100def settings
101101 size 800 , 800 , P2D
102102end
103-
You can’t perform that action at this time.
0 commit comments