diff --git a/stim/gl/gl_spider.h b/stim/gl/gl_spider.h index d6ee3f2..1add6e9 100644 --- a/stim/gl/gl_spider.h +++ b/stim/gl/gl_spider.h @@ -53,7 +53,8 @@ class gl_spider : public virtual gl_texture /* Method for finding the best direction for the spider. Not sure if necessary since the next position for the spider will be at direction * magnitude. */ - genTemplate(posVectors, 1); + + getSample(position, direction, magnitude); int best = getCost(); } @@ -236,6 +237,8 @@ class gl_spider : public virtual gl_texture hor.n()); UpdateBuffer(x, x+i*10.0); } + std::cout<< "Hmmm" << std::endl; + Update(); break; case 1: //Position if(cos(Y.dot(direction))< 0.087){ Y[0] = 0.0; Y[1] = 1.0;} @@ -451,9 +454,9 @@ class gl_spider : public virtual gl_texture (float pos_x, float pos_y, float pos_z, float dir_x, float dir_y, float dir_z, float mag_x) { - //setPosition(pos_x, pos_y, pos_z); - //setDirection(dir_x, dir_y, dir_z); - //setMagnitude(mag_x); + setPosition(pos_x, pos_y, pos_z); + setDirection(dir_x, dir_y, dir_z); + setMagnitude(mag_x); } ///@param GLuint id texture that is going to be sampled. ///@param numSamples number of samples per operation. @@ -466,7 +469,10 @@ class gl_spider : public virtual gl_texture GenerateFBO(20, numSamples*10); //sampleDirection(); genDirectionVectors(); - gl_texture::setDims(0.6, 0.6, 1.0); + genTemplate(posVectors, 1); + genPositionVectors(); + genMagnitudeVectors(); + gl_texture::setDims(0.6, 0.6, 2.0); //gl_texture::setDims(1.0, 1.0,1.0); } @@ -523,7 +529,21 @@ class gl_spider : public virtual gl_texture position[1] = y; position[2] = z; } - + + void getSample(vec pos, vec dir, vec mag) + { + Bind(); + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + vec temp = dir.sph2cart(); + glScalef(mag[0], mag[1], mag[0]); + //glRotatef(rotz, 0.0, 0.0, 1.0); + //glRotatef(roty, 0.0, 1.0, 0.0); + //glRotatef(rotx, 1.0, 0.0 ,0.0); + glTranslatef(pos[0], pos[1], pos[2]); + glScalef(1/512/S[0], 1/512/S[1], 1/512/S[2]); + Unbind(); + } ///@param vector dir, the new direction. ///Sets the direction vector to input vector dir. @@ -577,16 +597,6 @@ class gl_spider : public virtual gl_texture } - void - findOptimalDirection() - { - /* Method for finding the best direction for the spider. - Uses the camera to rotate. Then Calls Evaluate to find new cost. - */ - //sampleDirection(); - //samplePosition(); - //sampleMagnitude(); - } /* Method for initializing the cuda devices, necessary only there are multiple cuda devices */ -- libgit2 0.21.4