Skip to content

Commit 05ecfd5

Browse files
committed
fix movie sketches
1 parent 0653894 commit 05ecfd5

File tree

4 files changed

+9
-15
lines changed

4 files changed

+9
-15
lines changed

processing_app/library/video/movie/pixelate.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# using rectangles as pixels by reading the values stored
77
# in the current video frame pixels array.
88
#
9-
109
load_library :video
1110
include_package 'processing.video'
1211

@@ -17,7 +16,7 @@
1716
def setup
1817
sketch_title 'Pixelate'
1918
no_stroke
20-
@mov = Movie.new(self, 'transit.mov')
19+
@mov = Movie.new(self, data_path('transit.mov'))
2120
@num_pixels_wide = width / BLOCK_SIZE
2221
@num_pixels_high = height / BLOCK_SIZE
2322
@movie_color = []
@@ -46,6 +45,5 @@ def draw
4645
end
4746

4847
def settings
49-
size 640, 360, FX2D
48+
size 640, 360, P2D
5049
end
51-

processing_app/library/video/movie/reverse.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
# underlying gstreamer plugins used by gsvideo. For example, the
88
# theora codec does support backward playback, but not so the H264
99
# codec, at least in its current version.
10-
#
11-
#
1210
load_library :video, :video_event
1311
include_package 'processing.video'
1412

@@ -19,7 +17,7 @@ def setup
1917
background(0)
2018
@speed_set = false
2119
@once = true
22-
@mov = Movie.new(self, 'transit.mkv')
20+
@mov = Movie.new(self, data_path('transit.mkv'))
2321
mov.play
2422
end
2523

@@ -46,6 +44,5 @@ def movieEvent(m)
4644
end
4745

4846
def settings
49-
size 640, 360, FX2D
47+
size 640, 360
5048
end
51-

processing_app/library/video/movie/scratch.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
def setup
1414
sketch_title 'Scratch'
1515
background(0)
16-
@mov = Movie.new(self, 'transit.mov')
16+
@mov = Movie.new(self, data_path('transit.mov'))
1717
# Pausing the video at the first frame.
1818
mov.play
1919
mov.jump 0
@@ -24,7 +24,7 @@ def draw
2424
begin
2525
mov.read
2626
# A new time position is calculated using the current mouse location:
27-
t = mov.duration * map1d(mouse_x, (0..width), (0..1.0))
27+
t = mov.duration * norm(mouse_x, 0, width)
2828
mov.play
2929
mov.jump(t)
3030
mov.pause
@@ -33,5 +33,5 @@ def draw
3333
end
3434

3535
def settings
36-
size 640, 360, FX2D
36+
size 640, 360
3737
end

processing_app/library/video/movie/speed.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# drag mouse ip screen to decrease speed
44
# Uses the Movie.speed method to change
55
# the playback speed.
6-
76
load_libraries :video, :video_event
87
include_package 'processing.video'
98

@@ -12,7 +11,7 @@
1211
def setup
1312
sketch_title 'Speed'
1413
background(0)
15-
@mov = Movie.new(self, 'transit.mov')
14+
@mov = Movie.new(self, data_path('transit.mov'))
1615
mov.loop
1716
end
1817

@@ -31,5 +30,5 @@ def movieEvent(m)
3130
end
3231

3332
def settings
34-
size 640, 360, FX2D
33+
size 640, 360
3534
end

0 commit comments

Comments
 (0)