@jewel wrote:
I’d like to make a circle. But the circle is moving too fast. How can we solve this?
#include "ofApp.h" //-------------------------------------------------------------- void ofApp::setup(){ amplitude = 300; period = 240; angle = 0; Avelocity = 0.05; startAngle = 0.02; } //-------------------------------------------------------------- void ofApp::update(){ } //-------------------------------------------------------------- void ofApp::draw() { for (int i = 0; i < ofGetWidth(); i += 24) { y =ofMap(sin(angle),-1,1,0,ofGetHeight()); ofDrawCircle(i, y , 10); angle += Avelocity; } }
Posts: 2
Participants: 2