Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import RegExp
- import NetworkAccess
- import PointCloud
- import Animate
- feed "Earth quakes M >5", "http://earthquake.usgs.gov/earthquakes/catalogs/eqs7day-M5.xml"
- feed Title:text, URL:text ->
- page Title,
- clear_color 0, 0, 0, 1
- locally
- Scale := max (window_width / 1920, window_height / 1200)
- locally
- scale Scale, Scale, Scale
- translate -550, 350, 300
- rotatey 40
- color "yellow"
- text_box 0, 0, 600, 200,
- align 0.5
- vertical_align 0.5
- font "Ubuntu", 65
- text Title
- locally
- cloud_random "Stars", 3000
- color "white"
- translate 0, 0, -5000
- scale 5000, 5000, 3000
- rotatey 0.1 * time
- translate -0.5, -0.5, -0.5
- cloud "Stars"
- locally
- color "white"
- texture "http://www.motionstudios.de/images/dwm/Bild4.jpg"
- if texture_width <> 0 then
- earth_transform
- sphere 0, 0, 0, 900, 900, 900, 50, 50
- locally
- process_feed get_url_text URL
- Scale -> 0.666667
- earth_transform ->
- light 0
- light_position 1000, 1000, 1000
- scale Scale, Scale, Scale
- rotatey 5 * time
- Magnitude -> 6.0
- Latitude -> -12.5097
- Longitude -> 166.497
- process_feed T:text ->
- // Refresh every second until we get news feed, then every hour
- if T = "" then refresh 1 else refresh 3600
- regexp_parse_all T,
- - "<title>M (.*), (.*)</title>" -> Magnitude := real regexp_captured 1
- - "<geo:lat>(.*)</geo:lat>" -> Latitude := real regexp_captured 1
- - "<geo:long>(.*)</geo:long>" -> Longitude := real regexp_captured 1; plot Latitude + 0, Longitude + 0, Magnitude + 0
- key "w" -> WaveMode := 1 - WaveMode
- WaveMode -> 1
- Radius -> 16.5
- plot Lat:real, Long:real, Mag:real ->
- locally
- Radius := 15 * (Mag - 4.9)
- earth_transform
- rotatex -1.0 * Lat
- rotatey Long
- translatez 451
- if WaveMode = 1 then
- map_waves 0, 0, Radius
- else
- color "red"
- line_width 0
- circle 0, 0, Radius
- WaveCount -> 2
- map_circles 0, R -> false
- map_circles N:integer, R:real ->
- line_color "red", 0.7 * fade_out_at (N - 1 + page_time mod 1, WaveCount)
- circle 0, 0, (N - 1 + page_time mod 1) * R
- map_circles N - 1, R
- map_waves X:real, Y:real, R:real ->
- locally
- disable_depth_mask
- translate X, Y, 0
- color 0, 0, 0, 0
- line_width 3
- map_circles WaveCount, R
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement