Help!! (multi-dimensional array to hold color information)

edited October 2017 in How To...

We want to use a multi-dimensional array to hold color information to scroll through during each frame to change the background color. We want the frame rate to slow down so that the color transition does not make us sick when grading, make this rate 10 fps. You will have an 5 colors, use the colors provided in the table as the values for your array. Include your standard header with appropriate information.

R G B
0 0 255
255 0 0
0 255 0
161 74 162
244 252 15

How do I go about this?

Answers

    1. Enter all values into an array of PVectors.
    2. Have a number increase by 1 every time the loop runs.
    3. Have that number call from the array of PVectors inside of the background function.
  • Start with a simple working sketch and slowly add features without breaking anything until every step is done.

    The simplest sketch is one that does nothing. But even though it does nothing, there is still some code that you need to write to make it. You will need to have setup() and draw() functions. You will need to call size() is setup(). You should call background() in draw(). You can learn about these function by looking them up in the reference.

    Attempt to write a sketch that has a specific size and just sets the background color. Post the code of your attempt for more help.

  • edited October 2017

    use the colors provided in the table as the values for your array. Include your standard header with appropriate information.

    This looks like it was cut-pasted from a homework assignment. Is this problem homework, meant to teach you programming concepts?

    If it is homework, we can still help you -- we just won't give you full solutions outright.

    We want the frame rate to slow down so that the color transition does not make us sick when grading

    ...well, if they are planning on grading you, it is definitely homework....

  • Depending on the requirements for your solution, you may want to search the reference for lerpColor, and search the forum for lerpColor AND lerpColors

  • Enter all values into an array of PVectors.

    Why not an array of color?

    Have a number increase by 1 every time the loop runs.

    frameCount does this already

  • Its an assignment and I am supposed to use arrays to complete this.

Sign In or Register to comment.