Commit bda57892 authored by Kevin Dang's avatar Kevin Dang

updated Lux files:

• Added running movement to control
• Added landing page screen
parent 02e58ce0
No preview for this file type
......@@ -47,9 +47,9 @@ void Gui::setup(){
d3[4].setup("Diffuse 3", 0, 0, 255);
// s1[0].setup("Specular 1", 255, 255, 255);
// s2[0].setup("Specular 2", 255, 255, 255);
// s3[0].setup("Specular 3", 255, 255, 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);
......
......@@ -21,7 +21,7 @@ flocking::flocking(float _x, float _y, float _z): x(_x), y(_y), z(_z) {
void flocking::update(ofVec3f _tempPos) {
staticTarget.set(ofRandom(_tempPos.x-100,_tempPos.x+100),ofRandom(_tempPos.y-100,_tempPos.y+100),ofRandom(_tempPos.z-100,_tempPos.z+100));
staticTarget.set(_tempPos.x,_tempPos.y,_tempPos.z);
dir.normalize();
dir = dir * 0.1;
......
......@@ -50,7 +50,7 @@ void lightDrawing::draw() {
ofSetColor(255, 50);
float numPoints = polyline.size();
float tangentLength = 300;
float tangentLength = 800;
for (int p=0; p<500; p+=1) {
ofVec3f point = polyline.getPointAtPercent(p/500.0);
float floatIndex = p/500.0 * (numPoints-1);
......
......@@ -3,11 +3,11 @@
//========================================================================
int main( ){
ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
// pass in width and height too:
ofRunApp(new ofApp());
ofSetupOpenGL(1024,768,OF_FULLSCREEN); // <-------- setup the GL context
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
// pass in width and height too:
ofRunApp(new ofApp());
}
......@@ -54,7 +54,9 @@ void ofApp::camRotate(){
void ofApp::setup(){
ofSetVerticalSync(true);
state = 1;
state = 0;
landingPage.loadImage("landingPage.png");
mouseMode = false;
isMouseInited = false;
......@@ -63,11 +65,11 @@ void ofApp::setup(){
playerLocationX = 0;
playerLocationY = 0;
playerLocationZ = 0;
playerLocationZ = -600;
/*** Simon's Help Start ***/
planeDist = 100; // how far away you draw from screen
planeDist = 100;
cam.setPosition(playerLocationX,playerLocationY,playerLocationZ); // "this is like standing at a fixed position and aiming the camera around. we can pan the environment, search for a subject, or follow a moving subject"
cam.lookAt(ofVec3f(0,0,planeDist)); // "this typically happens when we are examining a subject, where we can move the camera closer/farther from the subject (fixed position), or orbit the camera around the subject"
......@@ -110,6 +112,8 @@ void ofApp::setup(){
light4.setSpecularColor( ofColor(255.f, 255.f, 255.f));
light4.setAreaLight(1000, 1000);
runningSpeed = 1;
}
//--------------------------------------------------------------
......@@ -178,24 +182,30 @@ void ofApp::update(){
//User Camera Movements
if (running) {
runningSpeed = 3;
} else {
runningSpeed = 1;
}
if (ofGetKeyPressed('w') == true) {
cam.dolly(-10.4);
cam.dolly(-1.4*runningSpeed);
}
if (ofGetKeyPressed('s') == true) {
cam.dolly(1.4);
cam.dolly(1.4*runningSpeed);
}
if (ofGetKeyPressed('a') == true) {
cam.truck(-1.4);
cam.truck(-1.4*runningSpeed);
}
if (ofGetKeyPressed('d') == true) {
cam.truck(1.4);
cam.truck(1.4*runningSpeed);
}
if (ofGetKeyPressed('q') == true) {
cam.boom(1.4);
cam.boom(1.4*runningSpeed);
}
if (ofGetKeyPressed('e') == true) {
cam.boom(-1.4);
cam.boom(-1.4*runningSpeed);
}
......@@ -277,20 +287,23 @@ void ofApp::draw(){
ofBackground(45);
ofEnableDepthTest();
ofEnableLighting();
light0.enable();
light1.enable();
light2.enable();
light3.enable();
light4.enable();
if (state == 0) {
ofSetColor(255);
landingPage.draw(0,0);
}
if (state == 1) {
ofEnableDepthTest();
ofEnableLighting();
light0.enable();
light1.enable();
light2.enable();
light3.enable();
light4.enable();
//Lighting
......@@ -362,7 +375,9 @@ void ofApp::keyPressed(int key){
if (state == 0) {
state++;
if (key == ' ') {
state++;
}
}
if (state == 1) {
......@@ -400,6 +415,13 @@ void ofApp::keyPressed(int key){
}
}
if (key == 'f') {
running = true;
}
} // end of state == 1
......@@ -414,7 +436,9 @@ void ofApp::keyReleased(int key){
LightDrawing.clearPreviousLine();
}
if (key == 'f') {
running = false;
}
} // end of state == 1
......
......@@ -7,7 +7,8 @@
#include "flocking.h"
#include <vector>
#include "populateSmallSphere.h"
class ofApp : public ofBaseApp{
class ofApp : public ofBaseApp {
public:
void setup();
......@@ -64,7 +65,9 @@ public:
vector <ofVec3f> newLightBallPosition;
bool running;
bool running, moveForward, moveBackward, moveLeft, moveRight, moveUp, moveDown;
float runningSpeed;
ofImage landingPage;
};
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