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
956e8886
Commit
956e8886
authored
Apr 21, 2016
by
Dat Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Quick Keys for lightsource selection
parent
5ca5cf98
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
144 additions
and
126 deletions
+144
-126
Final Project/Lux/.DS_Store
Final Project/Lux/.DS_Store
+0
-0
Final Project/Lux/bin/LuxDebug.app/Contents/MacOS/LuxDebug
Final Project/Lux/bin/LuxDebug.app/Contents/MacOS/LuxDebug
+0
-0
Final Project/Lux/src/Gui.cpp
Final Project/Lux/src/Gui.cpp
+25
-25
Final Project/Lux/src/Gui.h
Final Project/Lux/src/Gui.h
+2
-3
Final Project/Lux/src/ofApp.cpp
Final Project/Lux/src/ofApp.cpp
+102
-88
Final Project/Lux/src/ofApp.h
Final Project/Lux/src/ofApp.h
+15
-10
No files found.
Final Project/Lux/.DS_Store
0 → 100644
View file @
956e8886
File added
Final Project/Lux/bin/LuxDebug.app/Contents/MacOS/LuxDebug
View file @
956e8886
No preview for this file type
Final Project/Lux/src/Gui.cpp
View file @
956e8886
...
...
@@ -10,53 +10,49 @@
void
Gui
::
setup
(){
//Default Setting for Lighting
//Ambient and Diffuse
a1
[
0
].
setup
(
"Red"
,
0
,
0
,
255
);
a2
[
0
].
setup
(
"Green"
,
0
,
0
,
255
);
a3
[
0
].
setup
(
"Blue"
,
0
.
,
0
,
255
);
d1
[
0
].
setup
(
"Diffuse 1"
,
0
,
0
,
255
);
a3
[
0
].
setup
(
"Blue"
,
0
,
0
,
255
);
d1
[
0
].
setup
(
"Diffuse 1"
,
255
,
0
,
255
);
d2
[
0
].
setup
(
"Diffuse 2"
,
0
,
0
,
255
);
d3
[
0
].
setup
(
"Diffuse 3"
,
0
,
0
,
255
);
a1
[
1
].
setup
(
"Red"
,
0
,
0
,
255
);
a2
[
1
].
setup
(
"Green"
,
0
,
0
,
255
);
a3
[
1
].
setup
(
"Blue"
,
0
.
,
0
,
255
);
a3
[
1
].
setup
(
"Blue"
,
0
,
0
,
255
);
d1
[
1
].
setup
(
"Diffuse 1"
,
0
,
0
,
255
);
d2
[
1
].
setup
(
"Diffuse 2"
,
0
,
0
,
255
);
d2
[
1
].
setup
(
"Diffuse 2"
,
255
,
0
,
255
);
d3
[
1
].
setup
(
"Diffuse 3"
,
0
,
0
,
255
);
a1
[
2
].
setup
(
"Red"
,
0
,
0
,
255
);
a2
[
2
].
setup
(
"Green"
,
0
,
0
,
255
);
a3
[
2
].
setup
(
"Blue"
,
0
.
,
0
,
255
);
a3
[
2
].
setup
(
"Blue"
,
0
,
0
,
255
);
d1
[
2
].
setup
(
"Diffuse 1"
,
0
,
0
,
255
);
d2
[
2
].
setup
(
"Diffuse 2"
,
0
,
0
,
255
);
d3
[
2
].
setup
(
"Diffuse 3"
,
0
,
0
,
255
);
d3
[
2
].
setup
(
"Diffuse 3"
,
255
,
0
,
255
);
a1
[
3
].
setup
(
"Red"
,
0
,
0
,
255
);
a2
[
3
].
setup
(
"Green"
,
0
,
0
,
255
);
a3
[
3
].
setup
(
"Blue"
,
0
.
,
0
,
255
);
d1
[
3
].
setup
(
"Diffuse 1"
,
0
,
0
,
255
);
d2
[
3
].
setup
(
"Diffuse 2"
,
0
,
0
,
255
);
a3
[
3
].
setup
(
"Blue"
,
0
,
0
,
255
);
d1
[
3
].
setup
(
"Diffuse 1"
,
15
0
,
0
,
255
);
d2
[
3
].
setup
(
"Diffuse 2"
,
15
0
,
0
,
255
);
d3
[
3
].
setup
(
"Diffuse 3"
,
0
,
0
,
255
);
a1
[
4
].
setup
(
"Red"
,
0
,
0
,
255
);
a2
[
4
].
setup
(
"Green"
,
0
,
0
,
255
);
a3
[
4
].
setup
(
"Blue"
,
0
.
,
0
,
255
);
a3
[
4
].
setup
(
"Blue"
,
0
,
0
,
255
);
d1
[
4
].
setup
(
"Diffuse 1"
,
0
,
0
,
255
);
d2
[
4
].
setup
(
"Diffuse 2"
,
0
,
0
,
255
);
d3
[
4
].
setup
(
"Diffuse 3"
,
0
,
0
,
255
);
// s1[0].setup("Specular 1", 0, 0, 255);
// s2[0].setup("Specular 2", 0, 0, 255);
// s3[0].setup("Specular 3", 0, 0, 255);
//
// s1[1].setup("Specular 1", 255, 0, 255);
// s2[1].setup("Specular 2", 255, 0, 255);
// s3[1].setup("Specular 3", 255, 0, 255);
d2
[
4
].
setup
(
"Diffuse 2"
,
150
,
0
,
255
);
d3
[
4
].
setup
(
"Diffuse 3"
,
150
,
0
,
255
);
//Setup Sphere Selection Panel
select
.
setup
(
"Select Sphere"
);
select
.
add
(
selection
.
setup
(
"SphereNum"
,
0
,
0
,
4
));
//Add Int Slider for Sphere Selecting
select
.
add
(
selection
.
setup
(
"SphereNum"
,
1
,
1
,
5
));
//Setup Lighting Panel and add reference to array holding Diffuse and Ambient
//for light sources.
for
(
int
i
=
0
;
i
<
5
;
i
++
){
guiLighting
[
i
].
setup
(
"Lighting Controls"
);
guiLighting
[
i
].
add
(
&
a1
[
i
]);
...
...
@@ -70,9 +66,12 @@ void Gui::setup(){
guiLighting
[
i
].
add
(
&
s3
[
i
]);
}
//Setup Brush Panel
guiBrushes
.
setup
();
guiBrushes
.
setName
(
"Brush Effects"
);
//SetPosition
guiBrushes
.
setPosition
(
ofGetWindowWidth
()
-
210
,
10
);
//Setup Brushes for User usage
guiBrushes
.
add
(
standard
.
setup
(
"Standard"
,
true
));
guiBrushes
.
add
(
standardSize
.
setup
(
"Standard Brush Size"
,
2.
f
,
1.
f
,
10.
f
));
guiBrushes
.
add
(
bubbles
.
setup
(
"Bubble"
,
false
));
...
...
@@ -80,8 +79,9 @@ void Gui::setup(){
}
void
Gui
::
draw
(){
//Draw Panels and set Lighting panel under select panel
select
.
draw
();
guiLighting
[
selection
].
setPosition
(
select
.
getPosition
().
x
,
select
.
getPosition
().
y
+
50
);
guiLighting
[
selection
].
draw
();
guiLighting
[
selection
-
1
].
setPosition
(
select
.
getPosition
().
x
,
select
.
getPosition
().
y
+
50
);
guiLighting
[
selection
-
1
].
draw
();
guiBrushes
.
draw
();
}
\ No newline at end of file
Final Project/Lux/src/Gui.h
View file @
956e8886
...
...
@@ -18,14 +18,13 @@ public:
void
setup
();
void
draw
();
//Gui Sphere/Colours Panels & Sliders
ofxPanel
select
;
ofxPanel
guiLighting
[
5
];
ofxIntSlider
selection
;
ofxIntSlider
a1
[
5
],
a2
[
5
],
a3
[
5
],
d1
[
5
],
d2
[
5
],
d3
[
5
],
s1
[
5
],
s2
[
5
],
s3
[
5
];
vector
<
ofxIntSlider
>
a
,
aa
,
aaa
,
d
,
dd
,
ddd
,
s
,
ss
,
sss
;
//Gui Brush Panels & Sliders
ofxPanel
guiBrushes
;
ofxToggle
standard
,
bubbles
,
lightCluster
;
ofxFloatSlider
standardSize
;
...
...
Final Project/Lux/src/ofApp.cpp
View file @
956e8886
This diff is collapsed.
Click to expand it.
Final Project/Lux/src/ofApp.h
View file @
956e8886
...
...
@@ -33,7 +33,10 @@ public:
bool
intersectPlane
(
const
ofVec3f
&
n
,
const
ofVec3f
&
p0
,
const
ofVec3f
&
l0
,
const
ofVec3f
&
l
,
float
&
t
);
//GLFW static cast pointer
GLFWwindow
*
window
=
static_cast
<
ofAppGLFWWindow
*>
(
ofGetWindowPtr
())
->
getGLFWWindow
();
//Camera
ofCamera
cam
;
ofVec3f
pos
;
ofVec3f
ray
;
...
...
@@ -43,31 +46,33 @@ public:
float
playerLocationZ
;
float
planeDist
;
bool
running
,
moveForward
,
moveBackward
,
moveLeft
,
moveRight
,
moveUp
,
moveDown
;
float
runningSpeed
;
//Mouse
ofVec3f
p
;
bool
mouseMode
;
bool
isMouseHeldDown
;
bool
isMouseInited
;
lightDrawing
LightDrawing
;
GLFWwindow
*
window
=
static_cast
<
ofAppGLFWWindow
*>
(
ofGetWindowPtr
())
->
getGLFWWindow
();
//Lighting
ofLight
light0
,
light1
,
light2
,
light3
,
light4
;
Gui
userInterface
;
ofVec3f
lightPos
;
int
state
;
//UserInterface
Gui
userInterface
;
lightDrawing
LightDrawing
;
//Default World Objects
populateSmallSphere
smallSpheres
;
lightBalls
lightBalls
;
vector
<
ofVec3f
>
newLightBallPosition
;
bool
running
,
moveForward
,
moveBackward
,
moveLeft
,
moveRight
,
moveUp
,
moveDown
;
float
runningSpeed
;
//Startup Page
ofImage
landingPage
;
int
state
;
};
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