Skip to content

Commit

Permalink
VS Rand Update
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanminard committed Nov 9, 2013
1 parent 6222e8a commit 9d2d3ef
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
14 changes: 9 additions & 5 deletions CloudsLibrary/src/VisualSystems/RandomDigits/vs_src/Rand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
#include "Rand.h"

ofTrueTypeFont Rand::Font;
int Rand:: columns = 10;
int Rand:: rows = 20;
//int Rand:: columns = 15;
//int Rand:: rows = 25;

Rand:: Rand(float _posX, float _posY, float _randomNumber){
Rand::Rand(float _posX, float _posY, float _randomNumber,
int& minBri, int& maxBri)
{

posX = _posX;
posY = _posY;
Expand All @@ -21,6 +23,8 @@ Rand:: Rand(float _posX, float _posY, float _randomNumber){
previousRandomNumber =ofRandom(1000);
nextRandomNumber =0;
previousTime = 0;
this->minBri = &minBri;
this->maxBri = &maxBri;
}

void Rand::setup(){
Expand Down Expand Up @@ -68,11 +72,11 @@ void Rand::drawNumbers(){
std::string number = ostr.str();

if (abs(newRandomNumber - nextRandomNumber) >= 2){
float brightness = ofxTween::map(currentTime, 0, 1000.0, 100, 255, true, eq, ofxTween::easeInOut);
float brightness = ofxTween::map(currentTime, 0, 1000.0, *minBri, *maxBri, true, eq, ofxTween::easeInOut);
ofSetColor(brightness);
}
if (abs(newRandomNumber - nextRandomNumber) <= 2){
float brightness = ofxTween::map(currentTime, 0, 1000.0, 255, 100, true, eq, ofxTween::easeInOut);
float brightness = ofxTween::map(currentTime, 0, 1000.0, *maxBri, *minBri, true, eq, ofxTween::easeInOut);
ofSetColor(brightness);
}

Expand Down
11 changes: 5 additions & 6 deletions CloudsLibrary/src/VisualSystems/RandomDigits/vs_src/Rand.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ class Rand {
float posY;
int randomNumber;

static int columns; //columns of numbers
static int rows; //rows of numbers

//vector <int> randomNumbers;
//vector <int> noisyNumbers;

Rand(float posX, float posY, float posZ);
int* minBri;
int* maxBri;

Rand(float posX, float posY, float posZ,
int& minBri, int& maxBri);
void setup();
void noiseRotate(float _x, float _y);
void generateNoisyNumber();
Expand Down
2 changes: 1 addition & 1 deletion VSRandomDigits/RandomDigits.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -941,8 +941,8 @@
children = (
85797C1A18273432008A8F5E /* CloudsVisualSystemRandomDigits.cpp */,
85797C1B18273432008A8F5E /* CloudsVisualSystemRandomDigits.h */,
85797C1C18273432008A8F5E /* Rand.cpp */,
85797C1D18273432008A8F5E /* Rand.h */,
85797C1C18273432008A8F5E /* Rand.cpp */,
);
path = vs_src;
sourceTree = "<group>";
Expand Down

0 comments on commit 9d2d3ef

Please sign in to comment.