Permalink
Browse files

added 4 projects and a creative commons license

  • Loading branch information...
1 parent 609eb44 commit 860c30b5eb4d429b53db1299660ba6f2e318f586 @jtnimoy committed Jan 17, 2012
Showing with 13,011 additions and 0 deletions.
  1. BIN ChromeExperiments/chromeexperiments_badge_02.jpg
  2. +479 −0 ChromeExperiments/index.html
  3. +1,542 −0 ChromeExperiments/processing.js
  4. BIN ChromeExperiments/sound.swf
  5. BIN Cinder_Augmented_Reality/.DS_Store
  6. +15 −0 Cinder_Augmented_Reality/changes.txt
  7. +4 −0 Cinder_Augmented_Reality/include/Resources.h
  8. +2 −0 Cinder_Augmented_Reality/resources/.gitignore
  9. +82 −0 Cinder_Augmented_Reality/src/Ball.cpp
  10. +36 −0 Cinder_Augmented_Reality/src/Ball.h
  11. +465 −0 Cinder_Augmented_Reality/src/BallDroppingsApp.cpp
  12. +61 −0 Cinder_Augmented_Reality/src/EditLine.cpp
  13. +26 −0 Cinder_Augmented_Reality/src/EditLine.h
  14. +361 −0 Cinder_Augmented_Reality/src/jofSoundPlayer.cpp
  15. +85 −0 Cinder_Augmented_Reality/src/jofSoundPlayer.h
  16. +264 −0 Cinder_Augmented_Reality/src/quadstretch.cpp
  17. +35 −0 Cinder_Augmented_Reality/src/quadstretch.h
  18. +19 −0 Cinder_Augmented_Reality/vc10/BallDroppings.sln
  19. +118 −0 Cinder_Augmented_Reality/vc10/BallDroppings.vcxproj
  20. +32 −0 Cinder_Augmented_Reality/vc10/BallDroppings.vcxproj.filters
  21. +5 −0 Cinder_Augmented_Reality/vc10/Resources.rc
  22. BIN Cinder_Augmented_Reality/vc10/cinder_app_icon.ico
  23. +19 −0 Cinder_Augmented_Reality/vc9/BallDroppings.sln
  24. +209 −0 Cinder_Augmented_Reality/vc9/BallDroppings.vcproj
  25. +5 −0 Cinder_Augmented_Reality/vc9/Resources.rc
  26. BIN Cinder_Augmented_Reality/vc9/cinder_app_icon.ico
  27. BIN Cinder_Augmented_Reality/xcode/.DS_Store
  28. +1,489 −0 Cinder_Augmented_Reality/xcode/BallDroppings.xcodeproj/jtnimoy.mode1v3
  29. +695 −0 Cinder_Augmented_Reality/xcode/BallDroppings.xcodeproj/jtnimoy.pbxuser
  30. +436 −0 Cinder_Augmented_Reality/xcode/BallDroppings.xcodeproj/project.pbxproj
  31. +7 −0 Cinder_Augmented_Reality/xcode/BallDroppings_Prefix.pch
  32. BIN Cinder_Augmented_Reality/xcode/CinderApp.icns
  33. +28 −0 Cinder_Augmented_Reality/xcode/Info.plist
  34. +13 −0 Cinder_Augmented_Reality/xcode/Resources.h
  35. +1 −0 LICENSE
  36. BIN OpenFrameworks/.DS_Store
  37. BIN OpenFrameworks/data/.DS_Store
  38. BIN OpenFrameworks/data/sine.wav
  39. +20 −0 OpenFrameworks/openFrameworks-Info.plist
  40. +1,349 −0 OpenFrameworks/openFrameworks.xcodeproj/jtnimoy.mode1
  41. +406 −0 OpenFrameworks/openFrameworks.xcodeproj/jtnimoy.pbxuser
  42. +939 −0 OpenFrameworks/openFrameworks.xcodeproj/project.pbxproj
  43. +7 −0 OpenFrameworks/openFrameworks.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  44. BIN ...works.xcodeproj/project.xcworkspace/xcuserdata/jtnimoy.xcuserdatad/UserInterfaceState.xcuserstate
  45. +19 −0 ...meworks/openFrameworks.xcodeproj/xcuserdata/jtnimoy.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
  46. +84 −0 ...meworks/openFrameworks.xcodeproj/xcuserdata/jtnimoy.xcuserdatad/xcschemes/openFrameworks.xcscheme
  47. +22 −0 ...eworks/openFrameworks.xcodeproj/xcuserdata/jtnimoy.xcuserdatad/xcschemes/xcschememanagement.plist
  48. BIN OpenFrameworks/src/.DS_Store
  49. +115 −0 OpenFrameworks/src/Ball.cpp
  50. +46 −0 OpenFrameworks/src/Ball.h
  51. +129 −0 OpenFrameworks/src/EditLine.cpp
  52. +32 −0 OpenFrameworks/src/EditLine.h
  53. +60 −0 OpenFrameworks/src/FileUtils.cpp
  54. +34 −0 OpenFrameworks/src/FileUtils.h
  55. +183 −0 OpenFrameworks/src/LinkedList.cpp
  56. +42 −0 OpenFrameworks/src/LinkedList.h
  57. +6 −0 OpenFrameworks/src/LinkedListItem.cpp
  58. +17 −0 OpenFrameworks/src/LinkedListItem.h
  59. +87 −0 OpenFrameworks/src/V3.cpp
  60. +31 −0 OpenFrameworks/src/V3.h
  61. +16 −0 OpenFrameworks/src/main.cpp
  62. +738 −0 OpenFrameworks/src/testApp.cpp
  63. +93 −0 OpenFrameworks/src/testApp.h
  64. BIN Processing/.DS_Store
  65. +982 −0 Processing/JBallDroppings.java
  66. +981 −0 Processing/JBallDroppings.pde
  67. +40 −0 Processing/index.html
  68. BIN Processing/loading.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,15 @@
+0005
+
++ better deflection angles with shadows… should work better with black sticks.
+
+0004
+
++ sound works now
+
++ settings file has been moved to balldroppings.app/Contents/Resources/ so it won't get deleted from /tmp by the OS on bootup.
+
++ new key control capital Q will fit the quad to the window so the software can be tested without the projection setup.
+
++ green 'x' mode doesn't slow down the sim as much
+
++ keyboard keys '-' and '+' now adjust the collision threshold with more sensitivity
@@ -0,0 +1,4 @@
+#pragma once
+#include "cinder/CinderResources.h"
+
+//#define RES_MY_RES CINDER_RESOURCE( ../resources/, image_name.png, 128, IMAGE )
@@ -0,0 +1,2 @@
+*
+!.gitignore
@@ -0,0 +1,82 @@
+/*
+ * Ball.cpp
+ * BallDroppings
+ *
+ * Created by Josh Nimoy on 9/2/10.
+ *
+ */
+
+#include "Ball.h"
+#include <iostream>
+
+using namespace std;
+
+Vec2d Ball::gravity = Vec2d(0,0.3);
+double Ball::friction = 0.999;
+
+Ball::Ball(float xx,float yy):Vec2d(xx,yy){
+ radius = 3;
+ dead = false;
+ bounceTimer = 0;
+ force = Vec2d(0,0);
+}
+
+void Ball::step(){
+ (*this) += force;
+ force += gravity;
+ force *= friction;
+ radius--;
+ if(radius<3)radius = 3;
+
+
+ //kill if bouncing too often
+ if(bounces.size()>5)bounces.pop_front();
+ if(bounces.size()==5){
+ int accum = 0;
+ deque<int>::iterator it=bounces.begin();
+ for(;it!=bounces.end();it++){
+ accum += (*it);
+ }
+ if(accum < 10){
+ dead = true;
+ }
+ }
+
+ bounceTimer++;
+}
+
+
+void Ball::bounce( double x1, double y1, double x2, double y2 , ofSoundPlayer &snd){
+ //Thank you to Theo Watson for helping me out here.
+ //V
+ Vec2d v = Vec2d( force.x,force.y );
+
+ //N
+ Vec2d n = Vec2d(x2-x1,y2-y1);
+ n = Vec2d(-n.y , n.x);
+ n.normalize();
+
+ //2 * V [dot] N
+ double dotVec = 2 * v.dot(n);
+
+ // ( 2 * V [dot] N ) N
+ n *= dotVec;
+
+ //V - ( 2 * V [dot] N ) N
+ //change direction
+ Vec2d mvn = Vec2d(v.x - n.x, v.y - n.y);//minVecNew
+
+ force.x = mvn.x;
+ force.y = mvn.y;
+
+ //enlarge the ball
+
+ radius = sqrt(force.x*force.x + force.y*force.y);
+
+ snd.setSpeed(force.length()*0.2);
+ snd.play();
+
+ bounces.push_back(bounceTimer);
+ bounceTimer=0;
+}
+
@@ -0,0 +1,36 @@
+/*
+ * Ball.h
+ * BallDroppings
+ *
+ * Created by Josh Nimoy on 9/2/10.
+ *
+ */
+
+#pragma once
+
+#include "cinder/Vector.h"
+#include "cinder/audio/Output.h"
+#include "cinder/audio/Io.h"
+#include "Resources.h"
+#include "jofSoundPlayer.h"
+
+#include <deque>
+
+
+using namespace ci;
+using namespace std;
+
+class Ball:public Vec2d{
+public:
+ Ball(float x, float y);
+ Vec2d force;
+ static Vec2d gravity;
+ static double friction;
+ void step();
+ float radius;
+ void bounce( double x1, double y1, double x2, double y2 , ofSoundPlayer &snd);
+ bool dead;
+ deque<int>bounces;
+ int bounceTimer;
+};
+
Oops, something went wrong.

0 comments on commit 860c30b

Please sign in to comment.