diff options
Diffstat (limited to 'pluginchooser/src/pluginpanel.h')
| -rw-r--r-- | pluginchooser/src/pluginpanel.h | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/pluginchooser/src/pluginpanel.h b/pluginchooser/src/pluginpanel.h index fef4785..fd20d0d 100644 --- a/pluginchooser/src/pluginpanel.h +++ b/pluginchooser/src/pluginpanel.h @@ -21,6 +21,7 @@ public: input_index=_input_index; params=_params; iv.resize(_params.size()+_dimension); + plugin->setup (); } string name; AChaosBase *plugin; @@ -35,13 +36,13 @@ public: params[i].val=_params[i]; } } - ofVec2f calc(ofVec2f point){ - iv[input_index]=point.x; - iv[input_index+1]=point.y; + ofVec3f calc(ofVec3f point){ + iv[input_index]=point.x-(ofGetWidth()/2); + iv[input_index+1]=point.y-(ofGetHeight()/2); plugin->set(iv); plugin->calc(); vector<REAL> ov=plugin->getVec(); - return ofVec2f(ov[0],ov[1]); + return ofVec3f(ov[0]+(ofGetWidth()/2),ov[1]+(ofGetHeight()/2),0); } }; @@ -82,6 +83,15 @@ class pluginPanel : public ofxPanel { {"a",1.4f,-0.0f,2.0f}, {"b",0.3f,-1.0f,1.0f} } + ), + loader("ikeda",&ikeda, //4,2 a b nx ny perfect + 2,0, + { + {"a",0.85f,0.0f,2.0f}, + {"b",0.9f,0.0f,2.0f}, + {"k",0.4f,0.0f,2.0f}, + {"p",7.7f,0.0f,10.0f} + } ) }; index=0; @@ -142,7 +152,7 @@ class pluginPanel : public ofxPanel { clear(); add(label.setup(plugins[index].name)); add(active.set("use",false)); - add(amount.set("amount", 0.0f, 0.0f, 1.0f)); + add(amount.set("amount", 0.0f, -0.1f, 0.1f)); params.clear(); for (int i=0;i<plugins[index].params.size();i++){ ofParameter<float> param; @@ -157,10 +167,12 @@ class pluginPanel : public ofxPanel { } } void update(){ - //push params to plugin - plugins[index].update(params); + + //push params to plugin + plugins[index].update(params); + } - ofVec2f calc(ofVec2f point){ + ofVec3f calc(ofVec3f point){ if (active){ return (plugins[index].calc(point)*amount)+(point*(1.0f-amount)); } @@ -176,4 +188,5 @@ private: vector<ofParameter<float> > params; AChaosClifford clifford; AChaosHenon henon; + AChaosIkeda ikeda; };
\ No newline at end of file |
