Hi everyone,
I am struggling to change a set path command to my mouse position in “void ofApp::update()”. I don’t get any errors while compiling, however, the path doesn’t move.
I am assigning the path commands in:
void ofApp::setup(){
void ofApp::setup()
ofBackground(ofColor::black);
myPath.lineTo(20,20);
myPath.lineTo(ofGetWindowWidth() - 20, 20);
myPath.lineTo(ofGetWindowWidth() - 20, ofGetWindowHeight()-20);
myPath.lineTo(20, ofGetWindowHeight()-20);
myPath.close();
}
I am trying to update the first command in:
void ofApp::update(){
void ofApp::update()
vector <ofPath::Command> controls = myPath.getCommands();
for(int i = 0; i < controls.size(); i++) {
controls[0].to, (ofGetMouseX(), ofGetMouseY());
}
}
And finally drawing the path in:
void ofApp::draw()
void ofApp::draw(){
myPath.setFilled(false);
myPath.setStrokeWidth(5);
myPath.setStrokeColor(ofColor::white);
myPath.draw();
}
Please let me know if you have any advice. Thank you!