Commit 584b4eed authored by Sabrina Templeton's avatar Sabrina Templeton
Browse files

committing from fresh repository

parent 60af788a
......@@ -39,7 +39,7 @@ const int MAX_VERTS = 30;
// out vec3 v_Normal;
// out vec3 v_Parameter;
layout (triangle_strip, max_vertices = 40) out;
layout (triangle_strip, max_vertices = 80) out; //40?
//uniform usamplerBuffer connectivity;
uniform samplerBuffer seeds;
......@@ -136,7 +136,7 @@ void calc_poly(vec3 zi, vec3 zj, inout vec3[MAX_VERTS] curr_poly, int poly_space
//first step : start with just the initial polygon for now and perform one clip
vec3 new_poly[MAX_VERTS];//= vec3[4](vec3(0, 0, 0), vec3(0, 0, 0), vec3(0, 0, 0), vec3(0, 0, 0));
for (int i = 0; i < 4; i++) {
for (int i = 0; i < curr_poly.length(); i++) {
//curr_poly[i] = vec3( 0.1*i , 0, 0.0 );
//render_square(new_poly[i],0.05);
......@@ -168,7 +168,7 @@ void calc_poly(vec3 zi, vec3 zj, inout vec3[MAX_VERTS] curr_poly, int poly_space
else {
side2 = -1;
}
vec3 intersect = vec3(0, 0, 0);
vec3 intersect;
//again there's more to do here but I'm going to start by just calculating the intersection pt in the most hardcoded way possible
if (side1 != side2){
intersect = calc_intersect(zi, zj, b0, b1); //b0 and b1 are the current border points
......@@ -188,14 +188,16 @@ void calc_poly(vec3 zi, vec3 zj, inout vec3[MAX_VERTS] curr_poly, int poly_space
}
//otherwise both sides are -1 and we take neither
curr_poly = new_poly; // does this need to be a deep copy? I don't think so.
//test if the intersect point works
//render_square(intersect, .02);
}
//i believe this should be outside of the loop
curr_poly = new_poly; // does this need to be a deep copy? I don't think so.
//poly_space = 0; try without this for a sec
//test if the intersect point works
//render_square(intersect, .02);
......@@ -220,10 +222,10 @@ main() {
vec3 curr_poly3 = vec3(1, 1, 0);
vec3 curr_poly4 = vec3(0, 1, 0);
render_square(curr_poly1, .02);
render_square(curr_poly2, .02);
render_square(curr_poly3, .02);
render_square(curr_poly4, .02);
// render_square(curr_poly1, .02);
// render_square(curr_poly2, .02);
// render_square(curr_poly3, .02);
// render_square(curr_poly4, .02);
vec3 poly[MAX_VERTS];
vec3[MAX_VERTS] curr_poly;
......@@ -232,6 +234,13 @@ main() {
curr_poly[1] = curr_poly2;
curr_poly[2] = curr_poly3;
curr_poly[3] = curr_poly4;
int space = 0;
render_square(curr_poly[0], .03);
render_square(curr_poly[1], .03);
render_square(curr_poly[2], .03);
render_square(curr_poly[3], .03);
//************************************************************************************************
//This is a test of the the intersect function. It works!!
// vec3 test_pt = calc_intersect(vec3(.3, .5, 0), vec3(.3, -.5, 0), vec3(0, .5, 0), vec3(0, -.5, 0));
......@@ -242,25 +251,29 @@ main() {
//render_square(test, .06);
//render_square(vec3(0, 0,0 ), .05);
// this will obviously change once we are actually fetching from the nearest neighbor instead of the seed
for (int i = 1; i < 5; i ++){//super hardcoded for now
for (int i = 1; i < 2; i ++){//super hardcoded for now
vec3 nn0 = vec3(texelFetch( seeds, i).xy, 0);
// test.x += .1;
// test.y += .1;
// test.z += .1;
calc_poly(p0, nn0, curr_poly, 4);
calc_poly(p0, nn0, curr_poly, space);
// render_square(curr_poly[0], .03);
// render_square(curr_poly[1], .03);
// render_square(curr_poly[2], .03);
// render_square(curr_poly[3], .03);
}
//for loop doesn't work so just gonna repeat over and over
render_square(curr_poly[0], .03);
render_square(curr_poly[1], .03);
render_square(curr_poly[2], .03);
render_square(curr_poly[3], .03);
render_square(curr_poly[0], .01);
render_square(curr_poly[1], .01);
render_square(curr_poly[2], .01);
render_square(curr_poly[3], .01);
//render_square(vec3(0, 0, 0), .05);
......@@ -272,3 +285,4 @@ main() {
}
Supports Markdown
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