Skip to content

Commit

Permalink
just synching, trying to add some shaders too
Browse files Browse the repository at this point in the history
  • Loading branch information
CorpusCallosum committed Mar 3, 2014
1 parent 00ad15a commit bd83cbb
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 1 deletion.
Binary file not shown.
21 changes: 21 additions & 0 deletions lanscapesC_kinect/bin/data/shaders/shader.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

uniform float alphaAmt;

varying float normPos;
varying float filled;

/*float map(float value, float inputMin, float inputMax, float outputMin, float outputMax) {;
return clamp( ((value - inputMin) / (inputMax - inputMin) * (outputMax - outputMin) + outputMin), 0.0, 1.0);
}*/

void main(){

// gl_FragColor = gl_Color;
// gl_FragColor.a = alphaAmt * gl_Color.a;
//float expandedAlpha = map(normPos, 0.0, 1.0, .001, .999);
//float wipeValue = 1.- map(expandedAlpha, alphaAmt-.001, alphaAmt, 0., 1.0);
//float fadeValue = alphaAmt;
//gl_FragColor = vec4(gl_Color.rgb, mix(wipeValue,fadeValue,filled)*gl_Color.a);

gl_FragColor = gl_Color;
}
15 changes: 15 additions & 0 deletions lanscapesC_kinect/bin/data/shaders/shader.vert
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//varying vars get passed from the vertex shader to the fragment shader
varying float normPos;
varying float filled;
void main() {

normPos = gl_Normal.x;
filled = gl_Normal.y;

gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = ftransform();

//send vertex colors to the fragment shader
gl_FrontColor = gl_Color;

}
8 changes: 8 additions & 0 deletions lanscapesC_kinect/src/lanscapes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
//--------------------------------------------------------------
void lanscapes::setup(){

shader.load("shaders/shader");

//load settings xml data file
//-----------
//the string is printed at the top of the app
Expand Down Expand Up @@ -215,10 +217,16 @@ void lanscapes::draw(){
////DRAW THE MESH
//but we want to enable it to show the mesh
ofEnableDepthTest();
ofEnableSmoothing();

cam.begin();
//rotate the camera
ofRotateX(rotX);

//DRAW THE MESH!
shader.begin();
mainMesh.draw( bWireframe, bFaces );
shader.end();
cam.end();

////DRAW DEPTH IMAGES
Expand Down
2 changes: 2 additions & 0 deletions lanscapesC_kinect/src/lanscapes.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ class lanscapes : public ofBaseApp{

string message;

ofShader shader;

};
7 changes: 7 additions & 0 deletions lanscapesC_kinect/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ int main( ){
//ofSetupOpenGL(1024,768, OF_WINDOW);

ofAppGlutWindow window; //switched back to glut window to allow ofHideCursor()

// window.setGlutDisplayString("rgba double samples>=4");

// glutInitDisplayString( "rgba double samples>=4 ");



ofSetupOpenGL(&window, 1024,768, OF_WINDOW);

// this kicks off the running of my app
Expand Down
1 change: 1 addition & 0 deletions lanscapesC_kinect/src/meshGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ void meshGenerator::draw( bool wireframe, bool faces ) {
bDrawWireframe = wireframe;
bDrawFaces = faces;


if ( bDrawWireframe ) {
//draw the wireframe mesh
wireframeMesh.drawWireframe();
Expand Down
2 changes: 1 addition & 1 deletion printed_forms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ DATE (M/D/Y @ h:m:s): 05 / 14 / 12 @ 1:53:39am UTC

_-----Most recent list of prices for florida exhibition (this was from the email to andrea)

B. the prices of 6 sculptures, 4 of which will be on display, two won't but if they could be in the catalog that'd be awesome, whatever you think - see below:
B. the prices of 6 sculptures, 4 of which will be on display:

1. The largest white 3d printed sculpture on the largest shelf pedestal

Expand Down

0 comments on commit bd83cbb

Please sign in to comment.