Skip to content

Commit dbec45b

Browse files
committed
dubious queasycam examples
1 parent 916a160 commit dbec45b

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### READ ME ###
2+
3+
It is an unfortunate fact that queasycam uses PVector under the hood, this does not play too well with JRubyArt the decent thing would be create an interface?
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
load_library :queasycam
2+
include_package 'queasycam'
3+
4+
attr_reader :cam, :counter
5+
6+
def settings
7+
size(400, 400, P3D)
8+
end
9+
10+
def setup
11+
sketch_title 'Advanced Queasy Camera'
12+
@cam = QueasyCam.new(self)
13+
cam.sensitivity = 0.5
14+
cam.speed = 0.1
15+
perspektiv(
16+
fov: PI / 3,
17+
aspect_ratio: width.to_f / height,
18+
near_z: 0.01,
19+
far_z: 10000.0
20+
)
21+
@counter = 0
22+
end
23+
24+
def draw
25+
background(51)
26+
@counter += 0.005
27+
(-10..10).each do |x|
28+
(-10..10).each do |y|
29+
z = noise(x / 33.0 + counter, y / 33.0 + counter) * 50
30+
push_matrix
31+
translate(x * 5, z, y * 5)
32+
r = map1d(x, -10..10, 100..255)
33+
g = map1d(y, -10..10, 100..255)
34+
b = map1d(z, 0..10, 100..255)
35+
fill(r, g, b)
36+
box(1)
37+
pop_matrix
38+
end
39+
end
40+
end
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
load_library :queasycam
2+
include_package 'queasycam'
3+
4+
def settings
5+
size(400, 400, P3D)
6+
end
7+
8+
def setup
9+
sketch_title 'Basic Queasy Camera'
10+
QueasyCam.new(self)
11+
stroke_weight 3
12+
end
13+
14+
def draw
15+
background 0
16+
box 200
17+
end

0 commit comments

Comments
 (0)