We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi all!, I'm working on my thesis and I was wondering if someone could help me with my little problem!
I'm new in the Processing field, how could I create a real time animation of a sketch in the same frame of time in which i'm drawing it?
for example: if I draw a line on my tool, I'd like it to show (by pushing a button) how I created that line, through an animation.
If could also suggest me some readings or references, that would be very much appreciated. Thank you so much for your help and time.
Answers
You're going to have to break the animation down into individual frames. You can't just animate drawing a line in a single frame. By definition the animation will have to consist of multiple frames.
There are several ways to interpret this question -- please define your terms so we know what problem to help you with.
I'm assuming this tool is your processing sketch, e.g. you click with the mouse, drag, and release. Is this a line tool (straight line) or a pencil tool (trail of dots)?
If this is a line tool, do you want to play back everywhere the mouse was before the person finally released the button, dropping the final line segment? If this is a pencil tool, do you want to play back the trail of dots in order? should it be real-time (the speed of the mouse) or line-length time (x dots per second)?
References: see section tutorials, section reference, section examples, section books on the website
I would start with the Video Export library. I contains an example using PGraphics. You can draw to the PGraphics using the mouse. First, I would learn how to draw to a PGraphics and then save it as an image. If you save the image in Draw(), you will have as many frames as your sketch frameRate by the duration of the sketch. You can then compile the individual frames into a video. Or, more economically, use the Video Export library to render a video, frame by frame, directly from the PGraphics.
Yes, i was thinking to create a tool (the processing sketch) like a painting tool, what i want to create is like a drawing tool (paint tool) where i can draw some shapes (pencil tool - trail of dots) and, by clicking a button or keep it pressed, i would like to see the "creation" of my shape in a loop, like an animation.
Yes, i want to play back the trail of dots in order to see it "real time" (speed of the mouse).
The second step of my sketch would be creating "layers of animation" in order to controlling multiple "animations" at the same time.
Thanks for your answer!, really appreciated!
Thank you, for now I'll try to study PGraphics references!.
I tried to make some test in my sketch, and this is the result!.
I would like to create a line (and a shape, after) instead of a "moving dot", and add one button for "moving" between a "normal line", and an animated one!.
Do you have any suggestion? I'm looking forward to hearing from you guys!
Many thanks!
Something like this?
Yes!, it's a really good start, i tried to use this code on my computer and it works fine great, but if i try to put on my tablet doesn't work anymore.
The code for now is like this, my next steps i would like to "set" this "animation movement" only if i click a button (for drawing a "normal shape" like a background, and drawing another "shape" animated if i click the button).
For my next steps i would like to create this shapes like a layers for controlling the size, rotation ecc. I'll try to do my best, but is difficult for a Newbie like me, and i don't know i have enough power or memory for that.
TABLET: HUAWEI MediaPad T3 10 - EMUI 5.1 - CPU Snapdragon 425 - Ram 2 gb
I'm looking forward to hearing from you guys!
Many thanks!