11 ofSetLogLevel(OF_LOG_VERBOSE);
16 camera.setFarClip(1000000);
22 camera.setFarClip(10000000);
40 ofEnableAlphaBlending();
41 ofSetBackgroundAuto(
true);
48 receiver.setup(
PORT );
50 accel_x=accel_y=accel_z;
56 minAngularVelocity=10000;
57 maxAngularVelocity=(-1000);
58 minAccel=1000;maxAccel=-1000;
62 fonttodisplayWiimoteValues.loadFont(
"Inconsolata.otf", 20);
71 ofSetFullscreen(
true);
76 startingMovie.loadMovie(
"Intro_new.mov", OF_QTKIT_DECODE_TEXTURE_ONLY);
97 {cout<<
"ending"<<endl;
106 while( receiver.hasWaitingMessages())
108 if(windowWidth == 0 || windowHeight == 0){
109 windowWidth = ofGetWidth();
110 windowHeight = ofGetHeight();
116 receiver.getNextMessage( &m );
121 if ( m.getAddress() ==
"/wii/2/ir/0" )
123 x = m.getArgAsFloat( 0 );
125 wiiX = x * windowWidth;
126 cout <<
"x: " << wiiX <<
" y: " << wiiY <<
"\n";
128 else if ( m.getAddress() ==
"/wii/2/ir/1" )
130 y = 1 - m.getArgAsFloat( 0 );
131 wiiY = y * windowHeight;
132 cout <<
"x: " << wiiX <<
" y: " << wiiY <<
"\n";
134 else if (m.getAddress() ==
"/wii/1/accel/pry/1") {
135 roll = m.getArgAsFloat(0);
137 }
else if (m.getAddress() ==
"/wii/1/accel/pry/2") {
138 yaw = m.getArgAsFloat(0);
140 else if (m.getAddress() ==
"/wii/1/accel/pry/0") {
141 pitch = m.getArgAsFloat(0);
143 }
else if (m.getAddress() ==
"/wii/1/accel/pry/3") {
144 accel = m.getArgAsFloat(0);
147 else if(m.getAddress()==
"/wii/1/accel/xyz/0")
149 accel_x=m.getArgAsFloat(0);
152 else if(m.getAddress()==
"/wii/1/accel/xyz/1")
154 accel_y=m.getArgAsFloat(0);
157 else if(m.getAddress()==
"/wii/1/accel/xyz/2")
159 accel_z=m.getArgAsFloat(0);
162 else if(m.getAddress()==
"/wii/1/motion/velo/0")
163 angular_velocity=m.getArgAsFloat(0);
168 cout <<
"unrecognized message: " << m.getAddress() <<
"\n";
173 if(abs(angular_velocity*1000)<400)
174 prevAngVel=angular_velocity;
182 cout<<
"Acceleration :"<<accel<<endl;
218 ofBackground(0, 0, 0);
219 ofSetColor(255,255,255);
297 if(accel-0.2>0.008&&accel!=0)
299 if(angular_velocity<=-0.03)
301 ofSetColor(255, 0, 0);
303 if(State.compare(
"Front")==0)
310 else if(angular_velocity>=0.03)
313 ofSetColor(0,255, 0);
316 if(State.compare(
"Back")==0)
324 if(angular_velocity<minAngularVelocity)
325 minAngularVelocity=angular_velocity;
326 if(angular_velocity>maxAngularVelocity)
327 maxAngularVelocity=angular_velocity;
331 if(accel>maxAccel&&accel*1000<400)
340 if(maxAccel>204&&maxAccel<=214)
342 if(maxAccel>214&&maxAccel<=224)
344 if(maxAccel>224&&maxAccel<=234)
346 if(maxAccel>234&&maxAccel<=244)
348 if(maxAccel>244&&maxAccel<=254)
362 ofSetColor(255, 255, 255);
383 ofSetColor(255, 255, 255);
397 if(key==
'f'||key==
'F')
399 ofToggleFullscreen();
473 int spreadDistance=30;
487 float height=10000,radius=200,ang_freq=3.2;
490 for(
float angle=0;angle<=3600;angle+=0.01)
495 SpiralPoints.push_back(ofVec3f(((height-angle2)/height)*radius*cos(ofDegToRad(ang_freq*angle2)),((height-angle2)/height)*radius*sin(ofDegToRad(ang_freq*angle2)),6*angle2));
509 std::multimap<int,int>::iterator it;
534 float smoothnessFactor=2400,timeInterval=10;
576 float timeInterval=smoothnessFactor/1500;
606 cout<<
"\n User ID:"<<
id<<endl;
667 ofSetColor(255, 255, 255);
676 for(
int i=0;i<10000;i++)
677 StarPositions.push_back(ofVec3f(ofRandom(100000), ofRandom(10000),ofRandom(10000)));
687 ofDirectory untaggeddir(untaggedDirpath);
688 untaggeddir.allowExt(
"png");
689 untaggeddir.allowExt(
"jpg");
690 untaggeddir.allowExt(
"gif");
692 if(untaggeddir.listDir()==0)
696 cout<<
"Nothing"; ofExit();
699 cout<<untaggeddir.listDir();
700 cout<<
"NUMBER OF FILES"<<untaggeddir.numFiles()<<endl;
729 imagedataObject.
theloadedimage.loadImage(ofToString(untaggedDirpath+ofToString(j)+
".jpg"));
760 ofDirectory taggeddir(taggedDirpath);
762 taggeddir.allowExt(
"png");
763 taggeddir.allowExt(
"jpg");
764 taggeddir.allowExt(
"gif");
778 imagedataObject.
theloadedimage.loadImage(ofToString(taggedDirpath+ofToString(j)+
".jpg"));
799 int untaggedImageCount=0,taggedImageCount=0,i;
801 int taggedImgCount=0;
803 cout<<
"Combining and shuffling the tagged and untagged images";
809 if(i%ratio==0&&i!=0&&taggedImgCount<num_taggedImages)
838 cout<<
"Now checking the album numbers ,Size of the array = \t"<<
combinedImageObjects.size()<<endl;
852 float timeInterval=smoothnessFactor/500;