Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
creativeProjects2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kevin Dang
creativeProjects2
Commits
da1e5695
Commit
da1e5695
authored
Feb 09, 2016
by
Kevin Dang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated files - final version of tree
parent
c342d258
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
14 additions
and
113 deletions
+14
-113
lightPaintingFolder/Fractals/Fractals.xcodeproj/project.pbxproj
...aintingFolder/Fractals/Fractals.xcodeproj/project.pbxproj
+0
-6
lightPaintingFolder/Fractals/Fractals.xcodeproj/project.xcworkspace/xcuserdata/Kevin.xcuserdatad/UserInterfaceState.xcuserstate
...userdata/Kevin.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
lightPaintingFolder/Fractals/bin/FractalsDebug.app/Contents/MacOS/FractalsDebug
...actals/bin/FractalsDebug.app/Contents/MacOS/FractalsDebug
+0
-0
lightPaintingFolder/Fractals/src/Tree.cpp
lightPaintingFolder/Fractals/src/Tree.cpp
+0
-49
lightPaintingFolder/Fractals/src/Tree.h
lightPaintingFolder/Fractals/src/Tree.h
+0
-29
lightPaintingFolder/Fractals/src/branch.cpp
lightPaintingFolder/Fractals/src/branch.cpp
+4
-5
lightPaintingFolder/Fractals/src/branch.h
lightPaintingFolder/Fractals/src/branch.h
+0
-2
lightPaintingFolder/Fractals/src/ofApp.cpp
lightPaintingFolder/Fractals/src/ofApp.cpp
+9
-19
lightPaintingFolder/Fractals/src/ofApp.h
lightPaintingFolder/Fractals/src/ofApp.h
+1
-3
No files found.
lightPaintingFolder/Fractals/Fractals.xcodeproj/project.pbxproj
View file @
da1e5695
...
...
@@ -7,7 +7,6 @@
objects
=
{
/* Begin PBXBuildFile section */
0A521A451C675A9F004DC3ED
/* Tree.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0A521A441C675A9F004DC3ED
/* Tree.cpp */
;
};
0A705FA21C558A1000F81E1B
/* branch.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0A705FA11C558A1000F81E1B
/* branch.cpp */
;
};
E4328149138ABC9F0047C5CB
/* openFrameworksDebug.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E4328148138ABC890047C5CB
/* openFrameworksDebug.a */
;
};
E4B69E200A3A1BDC003C02F2
/* main.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E4B69E1D0A3A1BDC003C02F2
/* main.cpp */
;
};
...
...
@@ -44,8 +43,6 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
0A521A431C675A97004DC3ED
/* Tree.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
Tree.h
;
sourceTree
=
"<group>"
;
};
0A521A441C675A9F004DC3ED
/* Tree.cpp */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.cpp.cpp
;
path
=
Tree.cpp
;
sourceTree
=
"<group>"
;
};
0A705FA01C558A0500F81E1B
/* branch.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
branch.h
;
sourceTree
=
"<group>"
;
};
0A705FA11C558A1000F81E1B
/* branch.cpp */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.cpp.cpp
;
path
=
branch.cpp
;
sourceTree
=
"<group>"
;
};
E4328143138ABC890047C5CB
/* openFrameworksLib.xcodeproj */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.pb-project"
;
name
=
openFrameworksLib.xcodeproj
;
path
=
../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj
;
sourceTree
=
SOURCE_ROOT
;
};
...
...
@@ -113,8 +110,6 @@
E4B69E1E0A3A1BDC003C02F2
/* ofApp.cpp */
,
0A705FA01C558A0500F81E1B
/* branch.h */
,
0A705FA11C558A1000F81E1B
/* branch.cpp */
,
0A521A431C675A97004DC3ED
/* Tree.h */
,
0A521A441C675A9F004DC3ED
/* Tree.cpp */
,
);
path
=
src
;
sourceTree
=
SOURCE_ROOT
;
...
...
@@ -216,7 +211,6 @@
buildActionMask
=
2147483647
;
files
=
(
0A705FA21C558A1000F81E1B
/* branch.cpp in Sources */
,
0A521A451C675A9F004DC3ED
/* Tree.cpp in Sources */
,
E4B69E200A3A1BDC003C02F2
/* main.cpp in Sources */
,
E4B69E210A3A1BDC003C02F2
/* ofApp.cpp in Sources */
,
);
...
...
lightPaintingFolder/Fractals/Fractals.xcodeproj/project.xcworkspace/xcuserdata/Kevin.xcuserdatad/UserInterfaceState.xcuserstate
View file @
da1e5695
No preview for this file type
lightPaintingFolder/Fractals/bin/FractalsDebug.app/Contents/MacOS/FractalsDebug
View file @
da1e5695
No preview for this file type
lightPaintingFolder/Fractals/src/Tree.cpp
deleted
100644 → 0
View file @
c342d258
//
// Tree.cpp
// Fractals
//
// Created by Kevin Dang on 07/02/2016.
//
//
#include <stdio.h>
#include "Tree.h"
Tree
::
Tree
(
int
x_
,
int
y_
,
int
l_
,
int
s_
)
{
x
=
x_
;
y
=
y_
;
len
=
ofMap
(
l_
,
4
,
120
,
0.5
,
40
);
steps
=
s_
;
}
void
Tree
::
render
()
{
ofSetColor
(
255
);
ofFill
();
branch
(
x
,
y
,
-
HALF_PI
,
len
);
}
void
Tree
::
branch
(
float
x_
,
float
y_
,
float
a_
,
float
s_
)
{
ofSetLineWidth
(
10
);
float
a
=
ofRandom
(
-
PI
/
16
,
PI
/
16
)
+
a_
;
float
nx
=
cos
(
a
)
*
s_
+
x_
;
float
ny
=
sin
(
a
)
*
s_
+
y_
;
ofSetColor
(
255
);
ofFill
();
ofLine
(
x_
,
y_
,
nx
,
ny
);
if
(
s_
>
16
)
{
branch
(
nx
,
ny
,
a_
-
PI
/
4
,
s_
*
ofRandom
(
0.6
,
0.8
));
branch
(
nx
,
ny
,
a_
,
s_
*
ofRandom
(
0.6
,
0.8
));
branch
(
nx
,
ny
,
a_
+
ofRandom
(
PI
/
4
),
s_
*
ofRandom
(
0.6
,
0.8
));
}
else
{
ofSetColor
(
0
,
20
,
0
);
ofFill
();
ofCircle
(
x_
,
y_
,
20
);
}
}
lightPaintingFolder/Fractals/src/Tree.h
deleted
100644 → 0
View file @
c342d258
//
// Tree.h
// Fractals
//
// Created by Kevin Dang on 07/02/2016.
//
//
#ifndef Tree_h
#define Tree_h
#include "ofMain.h"
class
Tree
{
public:
float
x
,
y
;
float
len
;
float
steps
;
Tree
(
int
x_
,
int
y_
,
int
l_
,
int
s_
);
void
setup
();
void
render
();
void
branch
(
float
,
float
,
float
,
float
);
};
#endif
/* Tree_h */
lightPaintingFolder/Fractals/src/branch.cpp
View file @
da1e5695
...
...
@@ -16,8 +16,6 @@ void Branch::setup() {
theta
=
30.0
;
rotate
=
36.00
;
branchValue
=
180
;
testX
=
0
;
testY
=
0
;
}
...
...
@@ -43,7 +41,7 @@ float Branch::branch(float len) {
float
strokeWeight
=
ofMap
(
len
,
4
,
120
,
0.5
,
40
);
ofSetLineWidth
((
strokeWeight
*
.5
));
ofLine
(
testX
,
testY
,
0
,
-
len
);
ofLine
(
0
,
0
,
0
,
-
len
);
ofTranslate
(
0
,
-
len
);
// shrink the length of each branch when it grows
...
...
@@ -57,14 +55,15 @@ float Branch::branch(float len) {
ofRotate
(
theta
+
10
);
branch
(
len
);
ofPopMatrix
();
ofSetColor
(
60
);
ofPushMatrix
();
ofRotate
(
-
theta
);
branch
(
len
);
ofPopMatrix
();
}
else
{
ofSetColor
(
0
,
10
0
,
0
);
ofSetColor
(
160
,
0
,
0
);
ofFill
();
ofCircle
(
testX
,
testY
,
2
);
ofCircle
(
0
,
0
,
ofRandom
(
2
,
5
)
);
}
ofPopMatrix
();
...
...
lightPaintingFolder/Fractals/src/branch.h
View file @
da1e5695
...
...
@@ -19,8 +19,6 @@ public:
float
theta
,
rotate
;
bool
mousePressed
;
float
branchValue
;
float
testX
,
testY
;
};
...
...
lightPaintingFolder/Fractals/src/ofApp.cpp
View file @
da1e5695
...
...
@@ -2,10 +2,8 @@
//--------------------------------------------------------------
void
ofApp
::
setup
(){
// branches.setup();
// testing = 0;
tree
=
new
Tree
(
0
,
0
,
0
,
0
);
branches
.
setup
();
wholeRotate
=
0
;
}
...
...
@@ -17,20 +15,15 @@ void ofApp::update(){
//--------------------------------------------------------------
void
ofApp
::
draw
(){
//
ofPushMatrix();
//
ofTranslate(ofGetWindowWidth()/2, ofGetWindowHeight()-800);
// ofRotateY(testing
);
ofPushMatrix
();
ofTranslate
(
ofGetWindowWidth
()
/
2
,
ofGetWindowHeight
()
-
800
);
ofRotateY
(
wholeRotate
);
//
branches.draw();
branches
.
draw
();
// testing
+=0.5;
//
ofPopMatrix();
wholeRotate
+=
0.5
;
ofPopMatrix
();
// tree->render();
tree
=
new
Tree
(
ofGetWidth
()
/
2
,
ofGetHeight
(),
480
,
10
);
tree
->
render
();
}
...
...
@@ -58,15 +51,12 @@ void ofApp::mouseDragged(int x, int y, int button){
//--------------------------------------------------------------
void
ofApp
::
mousePressed
(
int
x
,
int
y
,
int
button
){
// branches.mousePressed = true;
}
//--------------------------------------------------------------
void
ofApp
::
mouseReleased
(
int
x
,
int
y
,
int
button
){
// branches.mousePressed = false;
// tree = new Tree(ofGetWidth()/2, ofGetHeight(), 480, 10);
// tree->render();
}
//--------------------------------------------------------------
...
...
lightPaintingFolder/Fractals/src/ofApp.h
View file @
da1e5695
...
...
@@ -2,7 +2,6 @@
#include "ofMain.h"
#include "branch.h"
#include "Tree.h"
class
ofApp
:
public
ofBaseApp
{
...
...
@@ -26,9 +25,8 @@ class ofApp : public ofBaseApp{
void
gotMessage
(
ofMessage
msg
);
Branch
branches
;
Tree
*
tree
;
// float testing
;
float
wholeRotate
;
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment