Skip to content

Commit

Permalink
custom hackpact 23 camera
Browse files Browse the repository at this point in the history
  • Loading branch information
obviousjim committed Dec 26, 2013
1 parent fd3d96a commit d445dfc
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ void CloudsVisualSystemOpenP5Hackpact::selfSetup(){
mesh.addVertex(ofVec3f());
}
}

mesh.setMode(OF_PRIMITIVE_POINTS);
mesh.setUsage(GL_STREAM_DRAW);
}

// selfPresetLoaded is called whenever a new preset is triggered
Expand All @@ -117,7 +118,15 @@ void CloudsVisualSystemOpenP5Hackpact::selfSceneTransformation(){

//normal update call
void CloudsVisualSystemOpenP5Hackpact::selfUpdate(){

//limit the camera movement
ofVec3f camposition;
camposition.x = ofMap(GetCloudsInputX(), 0, getSharedRenderTarget().getWidth(), 1800, 2000, true);
camposition.y = ofMap(GetCloudsInputY(), 0, getSharedRenderTarget().getHeight(), -30, 30, true);
camposition.z = 0;
camposition.rotate(35, ofVec3f(0,0,1));
// camposition.rotate(ofGetElapsedTimef(), ofVec3f(0,1,0));
simpleCam.setPosition(camposition);
simpleCam.lookAt(ofVec3f(0,0,0), ofVec3f(0,0,1));
}

// selfDraw draws in 3D using the default ofEasyCamera
Expand All @@ -131,19 +140,6 @@ void CloudsVisualSystemOpenP5Hackpact::selfDraw(){
for( int r = 10; r < 1000; r += 50){
for (int j = 0; j < N; j += 1) {

//P5
// float x = r*cos(radians(j));
// float y = r*sin(radians(j));
// rotateY(radians(beta));
//
// stroke(60,200,255-r/4);
// point(x, y, r);
// point(-x, -y, r);
//
// stroke(95,200,255-r/4);
// point(y, x, -r);
// point(-y, -x, -r);

//OF
float x = r*cos(ofDegToRad(j));
float y = r*sin(ofDegToRad(j));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@ class CloudsVisualSystemOpenP5Hackpact : public CloudsVisualSystem {
void selfMouseReleased(ofMouseEventArgs& data);


ofCamera simpleCam;
// if you use a custom camera to fly through the scene
// you must implement this method for the transitions to work properly
// ofCamera& getCameraRef(){
// return myCustomCamera;
// }
ofCamera& getCameraRef(){
return simpleCam;
}


protected:
Expand Down
8 changes: 4 additions & 4 deletions CloudsVisualSystemEditor/src/testView.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
}

- (int)selectedPresetIndex;
- (void) updateCurrentClipPresets;
- (void) updateCounts;

- (void)updateAssociatedClips;
- (void)updateCurrentClipPresets;
- (void)updateCounts;

- (void)setup;
- (void)update;
Expand Down Expand Up @@ -97,7 +97,7 @@ completionsForSubstring:(NSString *)substring

- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
- (NSArray *)tokenField:(NSTokenField *)tokenField shouldAddObjects:(NSArray *)tokens atIndex:(NSUInteger)index;
- (void) updateAssociatedClips;

- (BOOL) hasKeyword:(NSString*) keyword;
- (vector<string>) entries:(vector<string>&)a sharedWith:(vector<string>&)b;

Expand Down
4 changes: 2 additions & 2 deletions CloudsVisualSystemEditor/src/testView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ - (IBAction) deletePreset:(id)sender
if(self.selectedPresetIndex >= 0){
visualSystems.deletePreset( self.selectedPresetIndex );

[clipTable reloadData];
[suppressedClipTable reloadData];
[self updateAssociatedClips];

[presetTable reloadData];
[allKeywordTable reloadData];
[allClipTable reloadData];
Expand Down
29 changes: 29 additions & 0 deletions VSOpenP5Hackpact/OpenP5Hackpact.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@
E7E077E515D3B63C0020DFD4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */; };
E7E077E815D3B6510020DFD4 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E077E715D3B6510020DFD4 /* QTKit.framework */; };
E7E5EC2B1816731800CA4196 /* CloudsVisualSystemOpenP5Hackpact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7E5EC291816731800CA4196 /* CloudsVisualSystemOpenP5Hackpact.cpp */; };
E7FA8EBE186BF86F001AB5FB /* CloudsInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7FA8EB7186BF86F001AB5FB /* CloudsInput.cpp */; };
E7FA8EBF186BF86F001AB5FB /* CloudsInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7FA8EB7186BF86F001AB5FB /* CloudsInput.cpp */; };
E7FA8EC2186BF86F001AB5FB /* CloudsInputMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7FA8EBC186BF86F001AB5FB /* CloudsInputMouse.cpp */; };
E7FA8EC3186BF86F001AB5FB /* CloudsInputMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7FA8EBC186BF86F001AB5FB /* CloudsInputMouse.cpp */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -667,6 +671,12 @@
E7E077E715D3B6510020DFD4 /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = "<absolute>"; };
E7E5EC291816731800CA4196 /* CloudsVisualSystemOpenP5Hackpact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CloudsVisualSystemOpenP5Hackpact.cpp; sourceTree = "<group>"; };
E7E5EC2A1816731800CA4196 /* CloudsVisualSystemOpenP5Hackpact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CloudsVisualSystemOpenP5Hackpact.h; sourceTree = "<group>"; };
E7FA8EB7186BF86F001AB5FB /* CloudsInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CloudsInput.cpp; sourceTree = "<group>"; };
E7FA8EB8186BF86F001AB5FB /* CloudsInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CloudsInput.h; sourceTree = "<group>"; };
E7FA8EB9186BF86F001AB5FB /* CloudsInputEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CloudsInputEvents.h; sourceTree = "<group>"; };
E7FA8EBC186BF86F001AB5FB /* CloudsInputMouse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CloudsInputMouse.cpp; sourceTree = "<group>"; };
E7FA8EBD186BF86F001AB5FB /* CloudsInputMouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CloudsInputMouse.h; sourceTree = "<group>"; };
E7FA8EC4186BF92C001AB5FB /* CloudsGlobal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CloudsGlobal.h; path = ../../CloudsGlobal.h; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -1547,6 +1557,8 @@
E7E5EC271816731800CA4196 /* OpenP5Hackpact */ = {
isa = PBXGroup;
children = (
E7FA8EC4186BF92C001AB5FB /* CloudsGlobal.h */,
E7FA8EB6186BF86F001AB5FB /* Input */,
E7E5EC281816731800CA4196 /* vs_src */,
);
name = OpenP5Hackpact;
Expand All @@ -1572,6 +1584,19 @@
path = ../../CloudsLibrary;
sourceTree = "<group>";
};
E7FA8EB6186BF86F001AB5FB /* Input */ = {
isa = PBXGroup;
children = (
E7FA8EB7186BF86F001AB5FB /* CloudsInput.cpp */,
E7FA8EB8186BF86F001AB5FB /* CloudsInput.h */,
E7FA8EB9186BF86F001AB5FB /* CloudsInputEvents.h */,
E7FA8EBC186BF86F001AB5FB /* CloudsInputMouse.cpp */,
E7FA8EBD186BF86F001AB5FB /* CloudsInputMouse.h */,
);
name = Input;
path = ../../Input;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -1807,6 +1832,8 @@
850EE4CD1830708C004411A3 /* b2DistanceJoint.cpp in Sources */,
850EE4CE1830708C004411A3 /* CloudsVisualSystemOpenP5Hackpact.cpp in Sources */,
850EE5A6183070F8004411A3 /* ofxOculusRift.cpp in Sources */,
E7FA8EBF186BF86F001AB5FB /* CloudsInput.cpp in Sources */,
E7FA8EC3186BF86F001AB5FB /* CloudsInputMouse.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1931,6 +1958,8 @@
E72FF12417E688FE0007780D /* CloudsVisualSystem.cpp in Sources */,
2AAEF596180F136F005F33D3 /* b2DistanceJoint.cpp in Sources */,
E7E5EC2B1816731800CA4196 /* CloudsVisualSystemOpenP5Hackpact.cpp in Sources */,
E7FA8EBE186BF86F001AB5FB /* CloudsInput.cpp in Sources */,
E7FA8EC2186BF86F001AB5FB /* CloudsInputMouse.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down

0 comments on commit d445dfc

Please sign in to comment.