From 11229ede83c48fab01e6e566155536b5e7e9d762 Mon Sep 17 00:00:00 2001 From: Comment Date: Mon, 24 Jun 2013 23:18:03 +0100 Subject: yay --- 06_performance/src/oni.cpp | 18 +-- 06_performance/src/oni.h | 16 +++ 06_performance/src/testApp.cpp | 19 +++- 06_performance/src/testApp.h | 2 + testpoints/Makefile | 2 + testpoints/Makfile | 244 +++++++++++++++++++++++++++++++++++++++++ testpoints/addons.make | 5 + testpoints/config.mak | 56 ++++++++++ testpoints/config.make | 56 ++++++++++ testpoints/src/main.cpp | 18 +++ testpoints/src/testApp.cpp | 88 +++++++++++++++ testpoints/src/testApp.h | 33 ++++++ testpoints/testpoints.cbp | 51 +++++++++ 13 files changed, 595 insertions(+), 13 deletions(-) create mode 100644 testpoints/Makefile create mode 100644 testpoints/Makfile create mode 100755 testpoints/addons.make create mode 100755 testpoints/config.mak create mode 100644 testpoints/config.make create mode 100644 testpoints/src/main.cpp create mode 100644 testpoints/src/testApp.cpp create mode 100644 testpoints/src/testApp.h create mode 100755 testpoints/testpoints.cbp diff --git a/06_performance/src/oni.cpp b/06_performance/src/oni.cpp index 3f028fc..346adec 100644 --- a/06_performance/src/oni.cpp +++ b/06_performance/src/oni.cpp @@ -98,13 +98,13 @@ void syncOniPlayer::drawCloud(int step){ } void syncOniPlayer::drawPoints(float birth,float life,float dx,float dy, float dz,float size){ if (!drawable) return; - glEnable(GL_PROGRAM_POINT_SIZE); - glEnable(GL_POINT_SMOOTH); - glHint(GL_POINT_SMOOTH_HINT, GL_NICEST); + //glEnable(GL_PROGRAM_POINT_SIZE); + //glEnable(GL_POINT_SMOOTH); + //glHint(GL_POINT_SMOOTH_HINT, GL_NICEST); glEnable( GL_BLEND ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); //glPointSize( size); - glBegin(GL_POINTS); + //glBegin(GL_POINTS); const XnDepthPixel* depthmap=players[0]->getDepthGenerator().GetDepthMap(); const ofPixels& pixels=players[0]->getImagePixels(); int range=1700; @@ -121,7 +121,11 @@ void syncOniPlayer::drawPoints(float birth,float life,float dx,float dy, float d //fpoint f=fpoint(p.x, p.y, p.z,pixels[((j*step*dmw)+(i*step))*3],pixels[((j*step*dmw)+(i*step))*3]+1,pixels[((j*step*dmw)+(i*step))*3]+2); //f.draw(life,dx,dy,dz); if (pointPool.size()) {//take 1st dead particle - points[(*pointPool.begin())].setup(p.x, p.y, p.z,pixels[((j*step*dmw)+(i*step))*3],pixels[((j*step*dmw)+(i*step))*3]+1,pixels[((j*step*dmw)+(i*step))*3]+2); + points[(*pointPool.begin())].setup(p.x, p.y, p.z, + LUT[pixels[((j*step*dmw)+(i*step))*3]], + LUT[pixels[((j*step*dmw)+(i*step))*3]+1], + LUT[pixels[((j*step*dmw)+(i*step))*3]+2] + ); pointPool.erase(pointPool.begin()); } else {//make a new one @@ -134,9 +138,9 @@ void syncOniPlayer::drawPoints(float birth,float life,float dx,float dy, float d pointPool.insert(i); } } - glEnd(); + //glEnd(); glDisable( GL_BLEND ); - glDisable(GL_PROGRAM_POINT_SIZE); + //glDisable(GL_PROGRAM_POINT_SIZE); } int syncOniPlayer::getNumParticles(){ return points.size()-pointPool.size(); diff --git a/06_performance/src/oni.h b/06_performance/src/oni.h index 36d216a..c858995 100644 --- a/06_performance/src/oni.h +++ b/06_performance/src/oni.h @@ -22,9 +22,11 @@ class fpoint{ float l=ofGetElapsedTimef()-st; if (life>l) { glPointSize((1.0f-(l/life))*size); + glBegin(GL_POINTS); glColor3ub(r,g,b); //glColor4ub(r,g,b,(unsigned char)255); // ((l/life)*255.0f)); glVertex3f(x-(pow(l,2)*dx),y-(pow(l,2)*dy),z-(pow(l,2)*dz)); + glEnd(); return true; } else { @@ -37,9 +39,21 @@ class syncOniPlayer{ public: syncOniPlayer() { drawable=false; + gamma=3.0f; + LUT=NULL; + makeLUT(); } ~syncOniPlayer(){ stop(); + //if (LUT) delete[] LUT; + } + void makeLUT(){ + if (NULL==LUT){ + LUT=new uint8_t[0xff]; + } + for (int i=0;i<0xFF;i++) { + LUT[i]=(uint8_t)(pow(((float)i)/255.0f,gamma)*255.0f); + } } void addPlayer(string name); void play(); @@ -60,6 +74,8 @@ class syncOniPlayer{ bool drawable; vector points; set pointPool; + float gamma; + uint8_t *LUT; }; //======================================== class oniManager{ diff --git a/06_performance/src/testApp.cpp b/06_performance/src/testApp.cpp index 57749b0..746d52f 100644 --- a/06_performance/src/testApp.cpp +++ b/06_performance/src/testApp.cpp @@ -168,7 +168,10 @@ void testApp::setup(){ else printf("no video clips found!\n"); } } -} + + xOffs=startX=yOffs=startY=0; +}; + @@ -242,6 +245,9 @@ void testApp::update(){ for (int i=0;i videoclips; ofxOscReceiver receiver; + + float xOffs,startX,yOffs,startY; }; #endif diff --git a/testpoints/Makefile b/testpoints/Makefile new file mode 100644 index 0000000..2d83a77 --- /dev/null +++ b/testpoints/Makefile @@ -0,0 +1,2 @@ +include config.make +include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/Makefile.examples diff --git a/testpoints/Makfile b/testpoints/Makfile new file mode 100644 index 0000000..0ae1f0e --- /dev/null +++ b/testpoints/Makfile @@ -0,0 +1,244 @@ +# openFrameworks OS X makefile +# +# make help : shows this message +# make Debug: makes the application with debug symbols +# make Release: makes the app with optimizations +# make: the same as make Release +# make CleanDebug: cleans the Debug target +# make CleanRelease: cleans the Release target +# make clean: cleans everything +# +# +# this should work with any OF app, just copy any example +# change the name of the folder and it should compile +# only .cpp support, don't use .c files +# it will look for files in any folder inside the application +# folder except that in the EXCLUDE_FROM_SOURCE variable +# it doesn't autodetect include paths yet +# add the include paths in the USER_CFLAGS variable +# using the gcc syntax: -Ipath +# +# to add addons to your application, edit the addons.make file +# in this directory and add the names of the addons you want to +# include +# +# edit the following vars to customize the makefile + +include config.mak +ARCH = i386 + +COMPILER_OPTIMIZATION = $(USER_COMPILER_OPTIMIZATION) + +EXCLUDE_FROM_SOURCE="bin,.xcodeproj,obj" + +# you shouldn't modify anything below this line +SHELL = /bin/sh +CXX = g++ +LIBSPATH=osx + +NODEPS = clean +SED_EXCLUDE_FROM_SRC = $(shell echo $(EXCLUDE_FROM_SOURCE) | sed s/\,/\\\\\|/g) +SOURCE_DIRS = src +#$(shell find . -maxdepth 1 -mindepth 1 -type d | grep -v $(SED_EXCLUDE_FROM_SRC) | sed s/.\\///) +SOURCES = $(shell find $(SOURCE_DIRS) -name "*.cpp" -or -name "*.c") +OBJFILES = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCES))) +APPNAME = $(shell basename `pwd`) +CORE_INCLUDES = $(shell find $(OF_ROOT)/libs/openFrameworks/ -type d) +CORE_INCLUDE_FLAGS = $(addprefix -I,$(CORE_INCLUDES)) +INCLUDES = $(shell find $(OF_ROOT)/libs/*/include -type d | grep -v glu | grep -v quicktime | grep -v poco) +INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES)) +INCLUDES_FLAGS += -I$(OF_ROOT)/libs/poco/include +INCLUDES_FLAGS += -I$(OF_ROOT)/libs/glu/include +#INCLUDES_FLAGS += -I$(OF_ROOT)/libs/quicktime/include + +LIB_STATIC = $(shell ls $(OF_ROOT)/libs/*/lib/$(LIBSPATH)/*.a | grep -v openFrameworksCompiled | grep -v poco) +LIB_STATIC += $(OF_ROOT)/libs/fmodex/lib/osx/libfmodex.dylib +LIB_SHARED = $(shell ls $(OF_ROOT)/libs/*/lib/$(LIBSPATH)/*.so | grep -v openFrameworksCompiled | grep -v poco) +LIB_STATIC += $(OF_ROOT)/libs/poco/lib/$(LIBSPATH)/PocoNet.a $(OF_ROOT)/libs/poco/lib/$(LIBSPATH)/PocoXML.a $(OF_ROOT)/libs/poco/lib/$(LIBSPATH)/PocoUtil.a $(OF_ROOT)/libs/poco/lib/$(LIBSPATH)/PocoFoundation.a +LIB_PATHS_FLAGS = $(shell ls -d $(OF_ROOT)/libs/*/lib/$(LIBSPATH) | sed "s/\(\.*\)/-L\1/") + +CFLAGS += -Wall -fexceptions +CFLAGS += -I. +CFLAGS += $(INCLUDES_FLAGS) +CFLAGS += $(CORE_INCLUDE_FLAGS) +CFLAGS += -x c++ -arch $(ARCH) -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -Os -fasm-blocks -Wno-deprecated-declarations -Wno-invalid-offsetof -gdwarf-2 -msse3 -mssse3 + +LIBS += $(LIB_SHARED) +LIBS += $(LIB_STATIC) + +LDFLAGS = $(LIB_PATHS_FLAGS) -Wl +LIBS += -F$(OF_ROOT)/libs/glut/lib/osx -framework AppKit -framework Cocoa -framework IOKit -framework AGL -framework AudioToolbox -framework Carbon -framework CoreAudio -CoreFoundation -framework CoreServices -framework GLUT -framework OpenGL -framework Quicktime -framework CoreMidi -framework QTKit -framework QuartzCore -framework CoreVideo -framework Accelerate + +#Targets +ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug) + TARGET_CFLAGS = -g + TARGET_LIBS = $(OF_ROOT)/libs/openFrameworksCompiled/lib/osx/openFrameworksDebug.a + TARGET_NAME = Debug +endif + +ifeq ($(findstring Release,$(MAKECMDGOALS)),Release) + TARGET_CFLAGS = $(COMPILER_OPTIMIZATION) + TARGET_LIBS = $(OF_ROOT)/libs/openFrameworksCompiled/lib/osx/openFrameworks.a + TARGET_NAME = Release +endif + +ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug) + BIN_NAME = $(APPNAME)_debug + TARGET = bin/$(BIN_NAME) +endif + +ifeq ($(findstring Release,$(MAKECMDGOALS)),Release) + BIN_NAME = $(APPNAME) + TARGET = bin/$(BIN_NAME) +endif + +ifeq ($(findstring Release,$(MAKECMDGOALS)),clang) + CXX = clang +endif + +ifeq ($(MAKECMDGOALS),) + TARGET_NAME = Release + BIN_NAME = $(APPNAME) + TARGET = bin/$(BIN_NAME) + TARGET_LIBS = $(OF_ROOT)/libs/openFrameworksCompiled/lib/osx/openFrameworks.a +endif + +ifeq ($(MAKECMDGOALS),clean) + TARGET = bin/$(APPNAME)_debug bin/$(APPNAME) +endif + + +#Output +OBJ_OUTPUT = obj/$(TARGET_NAME)/ +CLEANTARGET = clean$(TARGET_NAME) +OBJS = $(addprefix $(OBJ_OUTPUT), $(OBJFILES)) +DEPFILES = $(patsubst %.o,%.d,$(OBJS)) +ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make) + ADDONS = $(shell cat addons.make) + ADDONS_REL_DIRS = $(addsuffix /src, $(ADDONS)) + ADDONS_LIBS_REL_DIRS = $(addsuffix /libs, $(ADDONS)) + ADDONS_DIRS = $(addprefix $(OF_ROOT)/addons/, $(ADDONS_REL_DIRS) ) + ADDONS_LIBS_DIRS = $(addprefix $(OF_ROOT)/addons/, $(ADDONS_LIBS_REL_DIRS) ) + ADDONS_BIN_LIBS_DIRS = $(addsuffix /*/lib/$(LIBSPATH), $(ADDONS_LIBS_DIRS) ) + ADDONS_INCLUDES = $(ADDONS_DIRS) + ADDONS_INCLUDES = $(ADDONS_LIBS_DIRS) + ADDONS_INCLUDES += $(shell find $(ADDONS_DIRS) -type d 2> /dev/null) + ADDONS_INCLUDES += $(shell find $(ADDONS_LIBS_DIRS) -type d 2> /dev/null) + ADDONSCFLAGS = $(addprefix -I,$(ADDONS_INCLUDES)) +ifeq ($(findstring libsorder.make,$(shell find $(ADDONS_BIN_LIBS_DIRS) -name libsorder.make 2> /dev/null)),libsorder.make) + ADDONS_LIBS_W_ORDER = $(shell cat $(shell find $(ADDONS_BIN_LIBS_DIRS) -name libsorder.make 2> /dev/null)) + SED_EXCLUDE_LIBS = $(addsuffix \|,$(ADDONS_LIBS_W_ORDER)) + ADDONS_LIBS_STATICS = $(shell find $(ADDONS_BIN_LIBS_DIRS) -name *.a 2> /dev/null | grep -v '$(SED_EXCLUDE_LIBS)') + else + ADDONS_LIBS_STATICS = $(shell find $(ADDONS_BIN_LIBS_DIRS) -name *.a 2> /dev/null) + endif + + ADDONS_LIBS_STATICS += $(addprefix -l, $(ADDONS_LIBS_W_ORDER)) + ADDONS_LIBS_STATICS += $(addprefix -L, $(shell find $(ADDONS_BIN_LIBS_DIRS) -name libsorder.make 2> /dev/null | sed s/libsorder.make//g)) + ADDONS_LIBS_SHARED = $(shell find $(ADDONS_BIN_LIBS_DIRS) -name *.so 2> /dev/null) + ADDONSLIBS = $(ADDONS_LIBS_STATICS) + ADDONSLIBS += $(ADDONS_LIBS_SHARED) + + + ADDONS_SOURCES = $(shell find $(ADDONS_DIRS) -name "*.cpp" -or -name "*.c" 2> /dev/null) + ADDONS_SOURCES += $(shell find $(ADDONS_LIBS_DIRS) -name "*.cpp" -or -name "*.c" -or -name "*.cc" 2>/dev/null) + ADDONS_OBJFILES = $(subst $(OF_ROOT)/, ,$(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(ADDONS_SOURCES))))) + ADDONS_OBJS = $(addprefix $(OBJ_OUTPUT), $(ADDONS_OBJFILES)) + DEPFILES += $(patsubst %.o,%.d,$(ADDONS_OBJS)) +endif + +.PHONY: Debug Release all after + +Release: $(TARGET) after + +Debug: $(TARGET) after + +all: + $(MAKE) Release + + + +#This rule does the compilation +#$(OBJS): $(SOURCES) +$(OBJ_OUTPUT)%.o: %.cpp + @echo "compiling object for: " $< + mkdir -p $(@D) + $(CXX) -c $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o$@ -c $< + +$(OBJ_OUTPUT)%.o: %.c + @echo "compiling object for: " $< + mkdir -p $(@D) + $(CXX) -c $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o$@ -c $< + + +$(OBJ_OUTPUT)%.o: $(OF_ROOT)/%.cpp + @echo "compiling addon object for" $< + mkdir -p $(@D) + $(CXX) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o $@ -c $< + +$(OBJ_OUTPUT)%.o: $(OF_ROOT)/%.c + @echo "compiling addon object for" $< + mkdir -p $(@D) + $(CXX) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o $@ -c $< + +$(TARGET): $(OBJS) $(ADDONS_OBJS) + @echo "linking" $(TARGET) $(GTK) + $(CXX) -arch $(ARCH) -v -o $@ $(OBJS) $(ADDONS_OBJS) $(USER_CFLAGS) $(LDFLAGS) $(USER_LDFLAGS) $(TARGET_LIBS) $(ADDONSLIBS) $(USER_LIBS) $(LIBS) + +-include $(DEPFILES) + +.PHONY: clean cleanDebug cleanRelease +clean: + rm -Rf obj + rm -f -v $(TARGET) + rm -Rf -v bin/libs + +$(CLEANTARGET): + rm -Rf -v $(OBJ_OUTPUT) + rm -f -v $(TARGET) + +after:$(TARGET) + @echo Preparing MacOS .app + #-rm -rf -v $(TARGET).app + mkdir -p $(TARGET).app/Contents/Frameworks + mkdir -p $(TARGET).app/Contents/MacOS + cp -r $(OF_ROOT)/libs/glut/lib/osx/* $(TARGET).app/Contents/Frameworks/ + cp -r $(OF_ROOT)/libs/fmodex/lib/osx/* $(TARGET).app/Contents/MacOS/ + cp $(TARGET) $(TARGET).app/Contents/MacOS/ + install_name_tool -change ./libfmodex.dylib @executable_path/libfmodex.dylib $(TARGET).app/Contents/MacOS/$(BIN_NAME) + @echo + @echo " compiling done" + @echo " to launch the application" + @echo + @echo " open $(TARGET).app" + @echo + + +.PHONY: help +help: + @echo + @echo openFrameworks universal makefile + @echo + @echo targets: + @echo "make Debug: builds the application with debug symbols" + @echo "make Release: builds the app with optimizations" + @echo "make: = make Release" + @echo "make all: = make Release" + @echo "make CleanDebug: cleans the Debug target" + @echo "make CleanRelease: cleans the Release target" + @echo "make clean: cleans everything" + @echo + @echo this should work with any OF app, just copy any example + @echo change the name of the folder and it should compile + @echo "only .cpp support, don't use .c files" + @echo it will look for files in any folder inside the application + @echo folder except that in the EXCLUDE_FROM_SOURCE variable. + @echo "it doesn't autodetect include paths yet" + @echo "add the include paths editing the var USER_CFLAGS" + @echo at the beginning of the makefile using the gcc syntax: + @echo -Ipath + @echo + @echo to add addons to your application, edit the addons.make file + @echo in this directory and add the names of the addons you want to + @echo include + @echo diff --git a/testpoints/addons.make b/testpoints/addons.make new file mode 100755 index 0000000..40e65eb --- /dev/null +++ b/testpoints/addons.make @@ -0,0 +1,5 @@ +ofxOpenNI +ofxXmlSettings +ofxMidi +ofxOsc + diff --git a/testpoints/config.mak b/testpoints/config.mak new file mode 100755 index 0000000..cb19ecf --- /dev/null +++ b/testpoints/config.mak @@ -0,0 +1,56 @@ +# add custom variables to this file + +# OF_ROOT allows to move projects outside apps/* just set this variable to the +# absoulte path to the OF root folder + +OF_ROOT = ../../../../../ + + +# USER_CFLAGS allows to pass custom flags to the compiler +# for example search paths like: +# USER_CFLAGS = -I src/objects + +USER_CFLAGS = -I $(OF_ROOT)/addons/ofxOpenNI/include/openni -I $(OF_ROOT)/addons/ofxOpenNI/include/nite -I $(OF_ROOT)/addons/ofxOpenNI/src + + +# USER_LDFLAGS allows to pass custom flags to the linker +# for example libraries like: +# USER_LDFLAGS = libs/libawesomelib.a + +#USER_LDFLAGS = -lOpenNI +USER_LDFLAGS = -L bin/data/openni/lib -L ../../../data/openni/lib/libusb-1.0.0.dylib -lOpenNI + +EXCLUDE_FROM_SOURCE="bin,.xcodeproj,obj" + +# change this to add different compiler optimizations to your project + +USER_COMPILER_OPTIMIZATION = -march=native -mtune=native -Os + + +# android specific, in case you want to use different optimizations +USER_LIBS_ARM = +USER_LIBS_ARM7 = +USER_LIBS_NEON = + +# android optimizations + +ANDROID_COMPILER_OPTIMIZATION = -Os + +NDK_PLATFORM = android-8 + +# uncomment this for custom application name (if the folder name is different than the application name) +#APPNAME = folderName + +# uncomment this for custom package name, must be the same as the java package that contains OFActivity +#PKGNAME = cc.openframeworks.$(APPNAME) + + + + + +# linux arm flags + +LINUX_ARM7_COMPILER_OPTIMIZATIONS = -march=armv7-a -mtune=cortex-a8 -finline-functions -funroll-all-loops -O3 -funsafe-math-optimizations -mfpu=neon -ftree-vectorize -mfloat-abi=hard -mfpu=vfp + + + diff --git a/testpoints/config.make b/testpoints/config.make new file mode 100644 index 0000000..e8ff248 --- /dev/null +++ b/testpoints/config.make @@ -0,0 +1,56 @@ +# add custom variables to this file + +# OF_ROOT allows to move projects outside apps/* just set this variable to the +# absoulte path to the OF root folder + +OF_ROOT = ../../openFrameworks + + +# USER_CFLAGS allows to pass custom flags to the compiler +# for example search paths like: +# USER_CFLAGS = -I src/objects + +USER_CFLAGS = -I $(OF_ROOT)/addons/ofxOpenNI/include/openni -I $(OF_ROOT)/addons/ofxOpenNI/include/nite -I $(OF_ROOT)/addons/ofxOpenNI/src + + +# USER_LDFLAGS allows to pass custom flags to the linker +# for example libraries like: +# USER_LDFLAGS = libs/libawesomelib.a + +USER_LDFLAGS = -lusb-1.0 -lOpenNI + + +EXCLUDE_FROM_SOURCE="bin,.xcodeproj,obj" + +# change this to add different compiler optimizations to your project + +USER_COMPILER_OPTIMIZATION = -march=native -mtune=native -Os + + +# android specific, in case you want to use different optimizations +USER_LIBS_ARM = +USER_LIBS_ARM7 = +USER_LIBS_NEON = + +# android optimizations + +ANDROID_COMPILER_OPTIMIZATION = -Os + +NDK_PLATFORM = android-8 + +# uncomment this for custom application name (if the folder name is different than the application name) +#APPNAME = folderName + +# uncomment this for custom package name, must be the same as the java package that contains OFActivity +#PKGNAME = cc.openframeworks.$(APPNAME) + + + + + +# linux arm flags + +LINUX_ARM7_COMPILER_OPTIMIZATIONS = -march=armv7-a -mtune=cortex-a8 -finline-functions -funroll-all-loops -O3 -funsafe-math-optimizations -mfpu=neon -ftree-vectorize -mfloat-abi=hard -mfpu=vfp + + +CXX=colorgcc diff --git a/testpoints/src/main.cpp b/testpoints/src/main.cpp new file mode 100644 index 0000000..cfae893 --- /dev/null +++ b/testpoints/src/main.cpp @@ -0,0 +1,18 @@ +#include "ofMain.h" +#include "testApp.h" + +//======================================================================== +int main( ){ + + //ofSetupOpenGL(4080,768, OF_WINDOW); // <-------- setup the GL context + ofSetupOpenGL(800,600, 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 testApp); + +} diff --git a/testpoints/src/testApp.cpp b/testpoints/src/testApp.cpp new file mode 100644 index 0000000..c62dcf3 --- /dev/null +++ b/testpoints/src/testApp.cpp @@ -0,0 +1,88 @@ +#include "testApp.h" + + /* + maybe draw pixel lines to a range of buffers and then play them in various 3D directions + pixel lines can have nice, missing corners and be nicely smoothed + + is it insane not to do this in vvvv + + can there be an editing interface + + have a play with vvvv/ max and try to replicate this idea QUICKLY? + */ + + +//-------------------------------------------------------------- +void testApp::setup(){ + + +} + + + +//-------------------------------------------------------------- +void testApp::update(){ + ofBackground(0,0,0); + for (int i=0;i<10;i++){ + points.push_back(ofPoint(ofRandom(ofGetWidth()),ofRandom(ofGetWidth()),ofRandom(ofGetWidth()))); + speeds.push_back(ofPoint(ofRandom(10)-5,ofRandom(10)-5,ofRandom(10)-5)); + colours.push_back(ofColor(ofRandom(127)+128,ofRandom(127)+128,ofRandom(127)+128)); + sizes.push_back(ofRandom(6)+1); + } +} + +//-------------------------------------------------------------- +void testApp::draw(){ + //glEnable(GL_PROGRAM_POINT_SIZE); + //glEnable(GL_POINT_SMOOTH); + //glHint(GL_POINT_SMOOTH_HINT, GL_NICEST); + glEnable( GL_BLEND ); + glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); + ofPushMatrix(); + ofTranslate(ofGetWidth()/2,ofGetHeight()/2,ofGetHeight()/2); + + for (int i=0;i points; + vector speeds; + vector colours; + vector sizes; + +}; + +#endif + + diff --git a/testpoints/testpoints.cbp b/testpoints/testpoints.cbp new file mode 100755 index 0000000..1f3b1ea --- /dev/null +++ b/testpoints/testpoints.cbp @@ -0,0 +1,51 @@ + + + + + + -- cgit v1.2.3