Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit bbfa1d3c9e261358c0064ac41abbb7ff43d48557 @elliotwoods committed Aug 28, 2012
@@ -0,0 +1,85 @@
+# Some general ignore patterns
+
+*/bin/*
+!*/bin/data/
+# for bin folder in root
+/bin/*
+!/bin/data/
+
+build/
+obj/
+*.o
+Debug*/
+Release*/
+*.mode*
+*.app/
+*.pyc
+.svn/
+
+# IDE-specific ignore patterns (e.g. user-specific files)
+
+#XCode
+*.pbxuser
+*.perspective
+*.perspectivev3
+*.mode1v3
+*.mode2v3
+#XCode 4
+xcuserdata
+*.xcworkspace
+
+#Code::Blocks
+*.depend
+*.layout
+*.cbTemp
+
+#Visual Studio
+*.sdf
+*.opensdf
+*.suo
+ipch/
+
+#Eclipse
+.metadata
+local.properties
+.externalToolBuilders
+
+# OS-specific ignore patterns
+
+#Linux
+*~
+# KDE
+.directory
+
+#OSX
+.DS_Store
+*.swp
+*~.nib
+# Thumbnails
+._*
+
+#Windows
+# Windows image file caches
+Thumbs.db
+# Folder config file
+Desktop.ini
+
+#Android
+.csettings
+
+# Packages
+# it's better to unpack these files and commit the raw source
+# git has its own built in compression methods
+*.7z
+*.dmg
+*.gz
+*.iso
+*.jar
+*.rar
+*.tar
+*.zip
+
+# Logs and databases
+*.log
+*.sql
+*.sqlite
@@ -0,0 +1,11 @@
+# ofxAssets
+
+## Introduction
+
+ofxAssets is an openFrameworks addon for simple access to assets inside your data folder.
+
+## Usage
+
+```c+++
+//insert usage here
+```
@@ -0,0 +1,9 @@
+//THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT.
+//THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED
+OF_PATH = ../../..
+
+//THIS HAS ALL THE HEADER AND LIBS FOR OF CORE
+#include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig"
+
+OTHER_LDFLAGS = $(OF_CORE_LIBS)
+HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS)
@@ -0,0 +1,6 @@
+#This file is currently only for linux users!
+#Add your addon and all other necessary ones here (without '#')
+#put every addon in one line, for example
+#myAddon
+#ofxXmlSettings
+#ofxOpenCv
No changes.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,19 @@
+#version 120
+
+void main(){
+ //this is the fragment shader
+ //this is where the pixel level drawing happens
+ //gl_FragCoord gives us the x and y of the current pixel its drawing
+
+ //we grab the x and y and store them in an int
+ float xVal = gl_FragCoord.x;
+ float yVal = gl_FragCoord.y;
+
+ //we use the mod function to only draw pixels if they are every 2 in x or every 4 in y
+ if( mod(xVal, 2.0) == 0.5 && mod(yVal, 4.0) == 0.5 ){
+ gl_FragColor = gl_Color;
+ }else{
+ gl_FragColor.a = 0.0;
+ }
+
+}
@@ -0,0 +1,90 @@
+#version 120
+
+uniform float timeValX = 1.0;
+uniform float timeValY = 1.0;
+uniform vec2 mouse;
+
+//generate a random value from four points
+vec4 rand(vec2 A,vec2 B,vec2 C,vec2 D){
+
+ vec2 s=vec2(12.9898,78.233);
+ vec4 tmp=vec4(dot(A,s),dot(B,s),dot(C,s),dot(D,s));
+
+ return fract(sin(tmp) * 43758.5453)* 2.0 - 1.0;
+}
+
+//this is similar to a perlin noise function
+float noise(vec2 coord,float d){
+
+ vec2 C[4];
+
+ float d1 = 1.0/d;
+
+ C[0]=floor(coord*d)*d1;
+
+ C[1]=C[0]+vec2(d1,0.0);
+
+ C[2]=C[0]+vec2(d1,d1);
+
+ C[3]=C[0]+vec2(0.0,d1);
+
+
+ vec2 p=fract(coord*d);
+
+ vec2 q=1.0-p;
+
+ vec4 w=vec4(q.x*q.y,p.x*q.y,p.x*p.y,q.x*p.y);
+
+ return dot(vec4(rand(C[0],C[1],C[2],C[3])),w);
+}
+
+
+void main(){
+
+ gl_TexCoord[0] = gl_MultiTexCoord0;
+
+ //get our current vertex position so we can modify it
+ vec4 pos = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;
+
+ //generate some noise values based on vertex position and the time value which comes in from our OF app
+ float noiseAmntX = noise( vec2(-timeValX + pos.x / 1000.0f, 100.0f), 20.0 );
+ float noiseAmntY = noise( vec2(timeValY + pos.y / 1000.0f, pos.x / 2000.0f), 20.0 );
+
+ //generate noise for our blue pixel value
+ float noiseB = noise( vec2(timeValY * 0.25, pos.y / 2000.0f), 20.0 );
+
+ //lets also figure out the distance between the mouse and the vertex and apply a repelling force away from the mouse
+ vec2 d = vec2(pos.x, pos.y) - mouse;
+ float len = sqrt(d.x*d.x + d.y*d.y);
+ if( len < 300 && len > 0 ){
+
+ //lets get the distance into 0-1 ranges
+ float pct = len / 300.0;
+
+ //this turns our linear 0-1 value into a curved 0-1 value
+ pct *= pct;
+
+ //flip it so the closer we are the greater the repulsion
+ pct = 1.0 - pct;
+
+ //normalize our repulsion vector
+ d /= len;
+
+ //apply the repulsion to our position
+ pos.x += d.x * pct * 90.0f;
+ pos.y += d.y * pct * 90.0f;
+ }
+
+ //modify our position with the smooth noise
+ pos.x += noiseAmntX * 20.0;
+ pos.y += noiseAmntY * 10.0;
+
+ //finally set the pos to be that actual position rendered
+ gl_Position = pos;
+
+ //modify our color
+ vec4 col = gl_Color;
+ col.b += noiseB;
+
+ gl_FrontColor = col;
+}
Oops, something went wrong.

0 comments on commit bbfa1d3

Please sign in to comment.