7:39 PM 14% -+ Write an openframeworks program to simulate a random walk. At eac
ID: 3751700 • Letter: 7
Question
7:39 PM 14% -+ Write an openframeworks program to simulate a random walk. At each step, toss a 4-sided coin: 0: move 10 pixels to the right 1: move 10 pixels to the left 2: move 10 pixels up ve 10 pixels do : mo Every 100 frames, change the path color (randomly). Here are some useful OF functions to use: void ofsetColor(int red, int green, int blue) void ofDrawLine (int xl, int yl, int x2, int y2) void ofSetBackgroundColor (int red, int green, int int ofGetFrameNum() blue) Note: To get the background not to clear at each frame, do this in the setup() function: ofSetBackgroundAuto(false) (a) What variables will you declare in ofApp.h?Explanation / Answer
variables will you declare in ofApp.h:
in ofApp.h,
in ofApp.cpp,
in myClass.h,
in myClass.cpp
If you run the code, It prints
VALUE : 1234567
#include "ofApp.h" int ofApp::getXSamples (float xMin, float xMax, float step, float x[]) { int i; int numSamples; numSa... ... //My Variables. float step = 0.1;.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.