Commit 956e8886 authored by Dat Nguyen's avatar Dat Nguyen

Added Quick Keys for lightsource selection

parent 5ca5cf98
......@@ -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", 150, 0, 255);
d2[3].setup("Diffuse 2", 150, 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
......@@ -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;
......
This diff is collapsed.
......@@ -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;
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment