I'd like to build something that works as the follower example...
Let's take a gemwin 9*9 pixels. So, 9 columns of pixels. In this gemwin we see the webcam or a video. Every column of pixels changes frame by frame (because video or webcam go on).
At frame_0, our gemwin is <000000000>, at frame_1 <111111111>, etc.
This is our gemwin frame by frame:
frame 0 <000000000>
frame 1 <111111111>
frame 2 <222222222>
...
But!..let's start again:
frame 0 <000000000>
I want to take a "snapshot" only of the central axis ("0"). When frame_1 arrives, I want to translate my shot of "0" towards left by one pixel...
frame 1 <111011111>
Now I want to repeat this action: I take a snapshot of the central axis (now "1"). And when frame_2 arrives, I want to translate both shot of "0" and shot of "1" towards left by one pixel...
frame 2 <220122222>
So, this is our gemwin frame by frame after this "shot&translate" process:
frame 0 <000000000>
frame 1 <111011111>
frame 2 <220122222>
frame 3 <301233333>
frame 4 <012344444>
frame 5 <123455555>
frame 6 <234566666>
frame 7 <345677777>
frame 8 <456788888>
frame 9 <567899999>
etc.
Ok...how can I do something like that? Which objects could I use?
Thanks
-
HELP: "shot" & translate pixels
-
C'mon guys, I need your help!
-
i would look into gridflow instead of GEM for this
-
Mmm... I never used gridflow, is there an object that does the work? Something in pd-extended's help browser?
-
this sounds intersting, although i don't understand quite a lot of it.
first the easy part:
"Let's take a gemwin 9*9 pixels. So, 9 columns of pixels. In this gemwin we see the webcam or a video. Every column of pixels changes frame by frame (because video or webcam go on)."you want to display a video or cam, with a resolution displayed in the gemwin of only 9x9 pixels?
so you get 9x9 coloured squares, that somewhat change colour if something happens in the video?for that, you could use a gemframebuffer. i accidentally wrote a pixelizer-thingy recently while trying to figure out framebuffering.
in the attached patch i more or less just a modified the framebuffer.readback help patch.- then you could use a pix_snap2tex with a sufficient size and offset to snap the row of pixels you want an texture them back onto a rectangle the size and position of the lefthand row of pixels. with each frame of the video, those rectangles need to move further to the left to make space for a new rectangle.
i don't quite understand, where the video is shown, when one axis (the "central", horizontal or vertical?) is being snapped.
would the video not be 9x9 pixels large?
is the video only shown on the right part of the screen?
the left part would be filled up by the shots frame by frame? -
Hi flo, and thanks for your answer+patch! I'll open your patch as soon as I write this post.
-No, I don't want to build a 9*9 gemwin. I said so, only to semplify my example...
000000000
111111111
etc.
Infact I think to use a standard 500*500 gemwin.
You asked to me "where the video is shown": my idea is to show the video onto gemwin, but to show only the right half of the entire video; while in left half of the video you should see the "overlap" and translation of the columns of pixels snapped every 40ms. That means...I don't try to resize the video into the right half of the gemwin. I try to show the entire video in the entire gemwin, but where in the left half of gemwin you can also see these "echoes" of the central vertical axis. -
I loaded your attached patch but Pd says <error: [gemframebuffer]: openGL framebuffer extension is not supported by this system>...
Advices? -
must have something to do with either your os or hardware.
apple opengl guide states:
"Framebuffer objects. A recently added OpenGL extension, these objects allow you to draw to buffers other than the usual buffers provided by OpenGL or the Mac OS X windowing system. Because these objects are window-system agnostic, they are easier to set up and more efficient to use than pixel buffers. Framebuffer objects are available in Mac OS X v10.4.3 and later, but not all hardware supports their use. See "Rendering to a Framebuffer Object."sorry...don't know how to solve this.