Animation with p5.js

For this assignment, I had to incorporate the following:

  • One element controlled by the mouse.
  • One element that changes over time, independently of the mouse.
  • One element that is different every time you run the sketch.

This sketch shows the sun and changes in the color of the sky as the sun sets. The yellow circle (the sun) is my object that is controlled by the mouse. The sun moves horizontally across the screen in sync with the mouse. The background in the sketch represents the sunset and changes over time. As the sun moves along the x axis it is setting, causing the sky to get darker (i.e) the background changes from blue to black. The background is also controlled by the mouse.

Stages of the sun and sky as the sun is setting:

Screen Shot 2015-09-14 at 5.29.32 PM

 

 

 

 

Screen Shot 2015-09-14 at 5.29.39 PM

 

 

 

 

Screen Shot 2015-09-14 at 5.29.43 PM

Here is my sunrise/sunset sketch.

I created a second sketch to showcase with use of the random variable and creating my own variables. When any key is pressed the background changes to black and the pattern repeats. The dimensions of the triangles are randomly generated. The sketch can be found here.

 

55 thoughts on “Animation with p5.js”

  1. I am just writing to make you understand what a really good experience my wife’s princess obtained using your webblog. She noticed some things, which included what it is like to possess an excellent teaching spirit to make others with no trouble learn about specific tortuous things. You undoubtedly surpassed readers’ expected results. Thanks for providing those productive, trusted, informative as well as unique tips on your topic to Mary.

  2. Thank you for every one of your hard work on this web page. My aunt really likes making time for investigations and it’s really obvious why. Most of us learn all of the lively mode you offer precious suggestions through this web site and even increase participation from some other people on the matter so our favorite girl is now learning a lot of things. Take advantage of the rest of the year. You are always doing a really great job.

  3. A lot of thanks for each of your hard work on this web page. Kim really likes going through investigation and it’s really easy to understand why. Many of us know all of the dynamic method you make powerful steps on this web blog and as well as improve participation from people on that issue so our girl is in fact learning a lot of things. Have fun with the remaining portion of the new year. You are conducting a pretty cool job.

  4. I precisely desired to say thanks again. I’m not certain the things I could possibly have achieved in the absence of the basics contributed by you about my area of interest. Completely was a challenging circumstance for me, but being able to view a expert approach you dealt with it forced me to cry for contentment. Extremely grateful for the advice and believe you are aware of a powerful job that you’re accomplishing educating many people all through a site. I’m certain you’ve never come across all of us.

  5. I am commenting to let you know of the fantastic encounter my cousin’s daughter experienced reading your site. She even learned many issues, not to mention what it’s like to have a wonderful giving mindset to have many people just grasp chosen grueling subject areas. You really exceeded our expectations. Many thanks for distributing the informative, healthy, educational and as well as easy thoughts on the topic to Jane.

  6. I precisely desired to say thanks again. I’m not certain the things I could possibly have carried out in the absence of the concepts contributed by you about my area of interest. Entirely was a daunting circumstance for me, but coming across a expert avenue you dealt with it forced me to cry for contentment. I’m grateful for the assistance and expect you are aware of a powerful job that you are accomplishing educating many people by way of a site. I am certain you’ve never come across all of us.

  7. The very next time I read a blog, Hopefully it does not disappoint me as much a

    펀초s this one. After all, Yes, it was my choice to read through, nonetheless I actually thought you would have something interesting to talk about. All I hear is a bunch of complaining about something that you can fix if you were not too busy looking for attention.

  8. Great goods from you, man. I have understand your stuff previous to and you are just extremely excellent.
    I actually like what you have acquired here, certainly like what you’re stating and the way in which you say it.
    You make it enjoyable and you still take care of to keep it wise.
    I can not wait to read far more from you. This is really a
    great site. http://www.deinformedvoters.org/aurogra-online

  9. Great work! This is the type of information that are meant to be shared around the net. Shame on the search engines for not positioning this put up upper!

  10. whoah this blog is magnificent i like reading your articles. Stay up the great work! You realize, lots of people are hunting around for this info, you can aid them greatly.

Leave a Reply

Your email address will not be published.