Skip to content

Commit 91e26d1

Browse files
committed
Try smooth(8)
1 parent 6ab74c4 commit 91e26d1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

processing_app/library/vector_utils/lat_lon.rb

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
require 'propane'
44
require 'arcball'
55
require 'csv'
6-
# Capital name, Latitude and Longitude from csv
7-
6+
# To store Capital name, Latitude and Longitude from csv
87
Place = Struct.new(:lat, :lon, :name)
98

10-
9+
# Sketch class
1110
class LatLong < Propane::App
1211
load_library :vector_utils
1312
# Uses to_cartesian to map lat lon of cities, read from a csv file, on a globe
1413
attr_reader :places
1514
def setup
1615
sketch_title 'Latitude and Longitude'
17-
noStroke
18-
textSize(9)
16+
smooth(8)
17+
no_stroke
18+
text_size(9)
1919
Processing::ArcBall.init self
2020
@places = []
2121
CSV.foreach(data_path('capitals.csv'), headers: true) do |row|
@@ -31,15 +31,15 @@ def draw
3131
lights
3232
counter = 0
3333
places.each do |place|
34-
p = VectorUtil.to_cartesian(lat: place.lat, long: place.lon, radius: 300)
34+
pos = VectorUtil.to_cartesian(lat: place.lat, long: place.lon, radius: 300)
3535
push_matrix
36-
translate(p.x, p.y, p.z)
37-
polar = VectorUtil.cartesian_to_polar(vec: p)
36+
translate(pos.x, pos.y, pos.z)
37+
polar = VectorUtil.cartesian_to_polar(vec: pos)
3838
rotate_y(polar.y)
3939
rotate_z(polar.z)
4040
push_matrix
4141
fill(255)
42-
text(place.name,0,0) if (counter % 3).zero?
42+
text(place.name, 0, 0) if (counter % 3).zero?
4343
pop_matrix
4444
fill(255, 255, 0, 100)
4545
box(8, 3, 3)

0 commit comments

Comments
 (0)