Skip to content

Commit f8f24e4

Browse files
committed
ditch yahoo weather
1 parent 5fd235d commit f8f24e4

File tree

6 files changed

+54
-53
lines changed

6 files changed

+54
-53
lines changed

Rakefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ task :vecmath do
3636
end
3737

3838
desc 'run shader samples'
39-
task :shader do
39+
task :shaders do
4040
FileUtils.cd(
4141
File.join(
4242
K9WD,
4343
'processing_app',
4444
'topics',
45-
'shader'
45+
'shaders'
4646
)
4747
)
4848
system 'rake'

contributed/data/sutcliffe.png

237 KB
Loading

contributed/recursive_pentagon.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def setup
77
sketch_title 'Recursive Pentagons'
88
@strut_factor = 0.2
99
@renderer = GfxRender.new self.g # so we can send Vec2D :to_vertex
10-
group = ColorGroup.from_web_array(PALETTE)
10+
group = ColorGroup.from_web_array(PALETTE.to_java(:string))
1111
@cols = group.colors
1212
background(cols.last)
1313
no_loop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Loading XML Data
2+
# by Martin Prout
3+
#
4+
# This example demonstrates how to use loadXML
5+
# to retrieve data from an XML document via a URL
6+
Weather = Struct.new(:location, :weather, :celsius, :fahrenheit)
7+
8+
9+
attr_reader :weather
10+
NOAA = 'KMIA' # NOAA Weather Miami Airport
11+
def setup
12+
sketch_title "NOAA's National Weather Service"
13+
# font = create_font('Times Roman', 26)
14+
# font = create_font('Merriweather-Light.ttf', 28)
15+
# text_font(font)
16+
# The URL for the XML document
17+
18+
fo = "https://w1.weather.gov/xml/current_obs/display.php?stid=%s"
19+
url = format(fo, NOAA)
20+
# Load the XML document
21+
xml = loadXML(url)
22+
@weather = Weather.new(
23+
xml.get_child('location'),
24+
xml.get_child('weather'),
25+
xml.get_child('temp_f'),
26+
xml.get_child('temp_c')
27+
)
28+
end
29+
30+
def draw
31+
background(255)
32+
fill(0)
33+
# Display all the stuff we want to display
34+
text(format("Location: %s", weather.location.get_content), width * 0.15, height * 0.36)
35+
text(format("Temperature: %s Fahrenheit", weather.fahrenheit.get_content), width * 0.15, height * 0.5)
36+
text(format("Temperature: %s Celsius", weather.celsius.get_content), width * 0.15, height * 0.66)
37+
text(format('Weather: %s', weather.weather.get_content), width * 0.15, height * 0.82)
38+
no_loop
39+
end
40+
41+
def settings
42+
size 600, 360
43+
end

processing_app/topics/advanced_data/yahoo_weather.rb

-41
This file was deleted.

processing_app/topics/shaders/image_filtering/metaballs.rb

+8-9
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ def setup
1010
@gaussian_blur = load_shader(data_path('gaussianBlur.glsl'))
1111
# @gaussian_blur = load_shader('gaussianBlur.glsl') # requires --nojruby flag
1212
gaussian_blur.set('kernelSize', 32) # How big is the sampling kernel?
13-
gaussian_blur.set('strength', 7.0) # How strong is the blur?
13+
gaussian_blur.set('strength', 7.0) # How strong is the blur?
1414
@threshold = load_shader(data_path('threshold.glsl'))
1515
# @threshold = load_shader('threshold.glsl')
1616
threshold.set('threshold', 0.5)
17-
threshold.set('antialiasing', 0.05) # values between 0.00 and 0.10 work best
17+
threshold.set('antialiasing', 0.05) # values between 0.00 and 0.10 work best
1818
end
1919

20-
def draw
21-
background(255)
20+
def draw
21+
background(200)
2222
# Draw some moving circles
2323
translate(width / 2,height / 2)
2424
no_stroke
@@ -29,18 +29,17 @@ def draw
2929
ellipse(-x, 0, 100, 100)
3030
y = map1d(sin(frame_count * 0.01), (-1.0..1.0), (-120.0..120.0))
3131
ellipse(0, y, 100, 100)
32-
ellipse(0, -y, 100, 100)
32+
ellipse(0, -y, 100, 100)
3333
# Vertical blur pass
3434
gaussian_blur.set('horizontalPass', 0)
35-
filter(gaussian_blur)
35+
filter(gaussian_blur)
3636
# Horizontal blur pass
3737
gaussian_blur.set('horizontalPass', 1)
38-
filter(gaussian_blur)
39-
filter(threshold)
38+
filter(gaussian_blur)
39+
filter(threshold)
4040
end
4141

4242

4343
def settings
4444
size(500, 500, P2D)
4545
end
46-

0 commit comments

Comments
 (0)