trying to create a dot at mouse position with horizontal motion. ?
in
Programming Questions
•
1 month ago
Hello World! pretty new to processing. Working on a little project based on a gif I made a few months ago and am having trouble finding a way to give horizontal motion to a shape created at the position of mousePressed. Would love any help or direction. Here is the gif and the idea
http://31.media.tumblr.com/4bbef2c30ec34ba0e3091ebeb4ed1953/tumblr_mlrpz8Rru51qza8zvo1_500.gif
The entire idea is for the sketch to live on the web allowing anyone to create shapes with the horizontal motion. "creating their own wind patterns"
taking it a step further would love to have ControlP5 to be able to toggle between strictly horizontal and a more random turbulent motion...
and even further a button that would create a gif from 15 frames of what was created.
Anyways I figured I would start with Example 3-5 from Daniel Shiffman, Learning Processing. Where I can create the dots but I can't figure out where or how I give the created shapes motion...
- // Learning Processing
- // Daniel Shiffman
- // http://www.learningprocessing.com
- // Example 3-5: mousePressed and keyPressed
- void setup() {
- size(200,200);
- background(255);
- }
- void draw() {
- // Nothing happens in draw() in this example!
- }
- // Whenever a user clicks the mouse the code written inside mousePressed() is executed.
- void mousePressed() {
- stroke(0);
- fill(175);
- rectMode(CENTER);
- rect(mouseX,mouseY,1,1);
- }
- // Whenever a user presses a key the code written inside keyPressed() is executed.
- void keyPressed() {
- background(255);
- }
any help greatly appreciated thanks!
1