Skip to content

Commit b1f7ed5

Browse files
committed
remove non-functionig sketch
1 parent d9a7f3a commit b1f7ed5

File tree

6 files changed

+14
-58
lines changed

6 files changed

+14
-58
lines changed

basics/modules/euler_integration.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# frozen_string_literal: true
22
require 'picrate'
3-
require_relative 'euler_ball'
43
# Euler Integration (v01)
54
# pos += spd
65
# sketch after Ira Greenwood
76
# Features first class keyword arguments, and use of modules
87
class EulerIntegration < Processing::App
8+
load_library :euler_ball
99

1010
attr_reader :ball
1111

basics/modules/euler_ball.rb renamed to basics/modules/library/euler_ball/euler_ball.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def bounds_collision
4040

4141
# Convenient boundary class, we only include MathTool module for constrain
4242
class Bounds
43-
include Processing::Proxy
43+
include MathTool
4444
attr_reader :low, :high, :inside
4545
def initialize(lower:, upper:)
4646
@low = lower

basics/modules/module_two.rb

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
require 'picrate'
2-
# Drawolver: draw 2D & revolve 3D
1+
# frozen_string_literal: true
32

3+
require 'picrate'
44
# Example to show how to use the VecMath library.
55
# Also the Array is extended to yield one_of_each using a module
66
# pair of pts. See the drawolver library. Also features the use each_cons,
@@ -11,32 +11,33 @@ class ModuleTwo < Processing::App
1111

1212
def setup
1313
sketch_title 'Module Two'
14-
@renderer = Java::MonkstoneVecmath::GfxRender.new(self.g)
14+
@renderer = Java::MonkstoneVecmath::GfxRender.new(g)
1515
frame_rate 30
1616
reset_scene
1717
end
1818

1919
def draw
2020
background 0
21-
if (!drawing_mode)
21+
unless drawing_mode
2222
translate(width / 2, height / 2)
2323
rotate_x rot_x
2424
rotate_y rot_y
2525
@rot_x += 0.01
2626
@rot_y += 0.02
27-
translate(-width/2, -height/2)
27+
translate(-width / 2, -height / 2)
2828
end
2929
no_fill
3030
stroke 255
3131
points.each_cons(2) { |ps, pe| line ps.x, ps.y, pe.x, pe.y }
3232
return if drawing_mode
33+
3334
stroke 125
3435
fill 120
3536
lights
3637
ambient_light 120, 120, 120
3738
vertices.each_cons(2) do |r1, r2|
3839
begin_shape(TRIANGLE_STRIP)
39-
ext_array = [r1,r2].extend ExtendedArray # extend an instance of Array
40+
ext_array = [r1, r2].extend ExtendedArray # extend an instance of Array
4041
ext_array.one_of_each do |v1, v2|
4142
v1.to_vertex(renderer)
4243
v2.to_vertex(renderer)
@@ -68,18 +69,18 @@ def mouse_released
6869

6970
def recalculate_shape
7071
@vertices = []
71-
points.each_cons(2) do |ps, pe|
72+
points.each_cons(2) do |ps, _pe|
7273
b = points.last - points.first
7374
len = b.mag
7475
b.normalize!
7576
a = ps - points.first
7677
dot = a.dot b
77-
b = b * dot
78+
b *= dot
7879
normal = points.first + b
7980
c = ps - normal
8081
nlen = c.mag
8182
vertices << []
82-
(0..TAU).step(PI/15) do |ang|
83+
(0..TAU).step(PI / 15) do |ang|
8384
e = normal + c * Math.cos(ang)
8485
e.z = c.mag * Math.sin(ang)
8586
vertices.last << e
@@ -97,12 +98,12 @@ module ExtendedArray
9798
# send one item from each array, expects array to be 2D:
9899
# array [[1,2,3], [a,b,c]] sends
99100
# [1,a] , [2,b] , [3,c]
100-
def one_of_each(&block)
101+
def one_of_each
101102
i = 0
102103
one = self[0]
103104
two = self[1]
104105
mi = one.length > two.length ? two.length : one.length
105-
while i < mi do
106+
while i < mi
106107
yield(one[i], two[i])
107108
i += 1
108109
end

library/vecmath/vec2d/data/java_args.txt

-2
This file was deleted.

library/vecmath/vec2d/data/sprite.png

-2.6 KB
Binary file not shown.

library/vecmath/vec2d/particle_system_pshape.rb

-43
This file was deleted.

0 commit comments

Comments
 (0)