Hello, I created a project using GryOSC app with OSC recieve. It is connected to my iPhone however, I can’t seem to control or move the animation. Can anyone help me?
This is the code:
void ofApp::update()
else if(m.getAddress() == "/gyrosc/gyro")
{
// the single argument is a string
Circles.gyroX= m.getArgAsFloat(0);
osc= m.getArgAsFloat(1);
Circles.gyroY= m.getArgAsFloat(2);
cout << m.getArgAsFloat(0) << " " << m.getArgAsFloat(1)<< " " << m.getArgAsFloat(2) << endl;
}
void LightCircle:: draw()
for (int i=20; i < ofGetWidth(); i = i+20)
{
for (int j=20; j<ofGetHeight(); j= j+20)
{
ofDrawEllipse(i, j, r , r);
diff[0] = cos(ofDegToRad(ofDist(i, j, cos(ofDegToRad(i))*ofGetWidth(), sin(ofDegToRad(j))*ofGetHeight())-ofGetFrameNum()*2))*r;
diff[1] = sin(ofDegToRad(ofDist(i, j, sin(ofDegToRad(i))*ofGetWidth()/2, cos(ofDegToRad(j))*ofGetHeight()/2)-ofGetFrameNum()*2))*r;
diff3 = cos(ofDegToRad(ofDist(i, j, cos(ofDegToRad(i))*ofGetWidth(), sin(ofDegToRad(j))*ofGetHeight())-ofGetFrameNum()*2))*r;
diff2 =ofDist(i, j, ofGetMouseX(), ofGetMouseY());
// mouse interaction
//if (ofDist(i, j, ofGetMouseX(), ofGetMouseY())<area*(1.2))
float LCx= ofMap(gyroX, -1.5, 1.5, 0, 300, clamp= true);
cout << "gyroX" << gyroX << endl;
float LCy= ofMap(gyroY, -1.5, 1.5, 0, 300, clamp= true);
cout << "gryoY" << gyroY << endl;
if(ofDist(LCx, LCy, i, j)<area*(1.2))
{
ofSetColor(0, 128, 255);
// ofDrawEllipse(i, j, r-(diff2), r-(diff2));
}
else if (ofDist(i, j, ofGetWidth()-size, ofGetHeight()-size)< area*10)
{
ofSetHexColor(0x00FF00);
// Size change in background
ofDrawEllipse(i, j, r-diff3, r-diff3);
//ofDrawEllipse(i, j, r, r);
}