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
a6095406
Commit
a6095406
authored
Apr 14, 2016
by
Dat Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added vector of lineWidths for standard brush
parent
5a29850b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
21 deletions
+22
-21
Lux/bin/LuxDebug.app/Contents/MacOS/LuxDebug
Lux/bin/LuxDebug.app/Contents/MacOS/LuxDebug
+0
-0
Lux/src/lightDrawing.cpp
Lux/src/lightDrawing.cpp
+18
-20
Lux/src/lightDrawing.h
Lux/src/lightDrawing.h
+4
-1
No files found.
Lux/bin/LuxDebug.app/Contents/MacOS/LuxDebug
View file @
a6095406
No preview for this file type
Lux/src/lightDrawing.cpp
View file @
a6095406
...
...
@@ -33,8 +33,9 @@ void lightDrawing::draw() {
ofPushStyle
();
ofSetColor
(
255
);
ofSetLineWidth
(
standardSize
);
for
(
int
i
=
0
;
i
<
drawLine
.
size
();
i
++
)
{
ofSetLineWidth
(
lineWidth
[
i
]);
drawLine
[
i
].
draw
();
drawLine
[
i
].
getSmoothed
(
1
);
}
...
...
@@ -68,21 +69,28 @@ void lightDrawing::draw() {
void
lightDrawing
::
clearPreviousLine
()
{
// only allows you to delete the last added element
if
(
drawLine
.
size
()
>
0
)
{
// you need this condition or the program will crash
if
(
drawLine
.
size
()
>
0
&&
lineWidth
.
size
()
>
0
)
{
// you need this condition or the program will crash
drawLine
.
pop_back
();
//Remove previous line width
lineWidth
.
pop_back
();
}
}
void
lightDrawing
::
mouseDragged
(
ofVec3f
_pos
)
{
drawLine
[
drawLine
.
size
()
-
1
].
addVertex
(
_pos
);
drawLine
[
drawLine
.
size
()
-
1
].
addVertex
(
_pos
);
}
void
lightDrawing
::
mouseRPressed
()
{
lineWidth
.
push_back
(
standardSize
);
drawLine
.
push_back
(
ofPolyline
());
}
...
...
@@ -93,6 +101,7 @@ void lightDrawing::mousePressed(ofVec3f _pos) {
currentPolyline
.
curveTo
(
_pos
.
x
,
_pos
.
y
,
_pos
.
z
);
currentPolyline
.
curveTo
(
_pos
.
x
,
_pos
.
y
,
_pos
.
z
);
lastPoint
.
set
(
_pos
.
x
,
_pos
.
y
,
_pos
.
z
);
}
...
...
@@ -104,10 +113,6 @@ void lightDrawing::mouseReleased(ofVec3f _pos) {
}
void
lightDrawing
::
bubblesetup
(){
}
void
lightDrawing
::
bubbledraw
(){
for
(
int
i
=
0
;
i
<
storeSphere
.
size
();
i
++
){
storeSphere
[
i
].
draw
();
...
...
@@ -116,18 +121,11 @@ void lightDrawing::bubbledraw(){
void
lightDrawing
::
createbubble
(
ofVec3f
_pos
){
sphere
.
setRadius
(
ofRandom
(
0.01
,
2
));
storeSphere
.
push_back
(
sphere
);
storeSphere
[
storeSphere
.
size
()
-
1
].
setPosition
(
_pos
+
ofVec3f
(
ofRandom
(
-
5
,
5
),
ofRandom
(
-
5
,
5
),
ofRandom
(
-
5
,
5
)));
sphere
.
setRadius
(
ofRandom
(
0.01
,
2
));
storeSphere
.
push_back
(
sphere
);
storeSphere
[
storeSphere
.
size
()
-
1
].
setPosition
(
_pos
+
ofVec3f
(
ofRandom
(
-
5
,
5
),
ofRandom
(
-
5
,
5
),
ofRandom
(
-
5
,
5
)));
sphere
.
setRadius
(
ofRandom
(
0.01
,
2
));
storeSphere
.
push_back
(
sphere
);
storeSphere
[
storeSphere
.
size
()
-
1
].
setPosition
(
_pos
+
ofVec3f
(
ofRandom
(
-
5
,
5
),
ofRandom
(
-
5
,
5
),
ofRandom
(
-
5
,
5
)));
for
(
int
i
=
0
;
i
<
3
;
i
++
){
sphere
.
setRadius
(
ofRandom
(
0.01
,
2
));
storeSphere
.
push_back
(
sphere
);
storeSphere
[
storeSphere
.
size
()
-
1
].
setPosition
(
_pos
+
ofVec3f
(
ofRandom
(
-
5
,
5
),
ofRandom
(
-
5
,
5
),
ofRandom
(
-
5
,
5
)));
}
}
Lux/src/lightDrawing.h
View file @
a6095406
...
...
@@ -33,15 +33,18 @@ public:
float
minDistance
;
vector
<
ofPolyline
>
polylines
;
vector
<
float
>
lineWidth
;
void
mousePressed
(
ofVec3f
_pos
);
void
mouseReleased
(
ofVec3f
_pos
);
vector
<
ofSpherePrimitive
>
storeSphere
;
ofSpherePrimitive
sphere
;
void
bubblesetup
();
void
bubbledraw
();
void
createbubble
(
ofVec3f
_pos
);
};
...
...
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