Commit 879321c4a5e974144996aae02c44c6583e4a2fbd

Authored by Pavel Govyadinov
1 parent 2dbd88bd

minor changes

Showing 1 changed file with 10 additions and 2 deletions   Show diff stats
gl/gl_spider.h
... ... @@ -142,9 +142,10 @@ class gl_spider : public virtual gl_texture<T>
142 142 ver = stim::rect<float>(position, direction, (Y.cross(direction)).norm());
143 143 ver.scale(magnitude[0], magnitude[1]);
144 144 */
145   - hor = stim::rect<float>(magnitude, position, direction.norm(), Y);
  145 + hor = stim::rect<float>(magnitude, position, direction.norm(),
  146 + ((Y.cross(direction)).cross(direction)).norm());
146 147 ver = stim::rect<float>(magnitude, position, direction.norm(),
147   - (Y.cross(direction)).norm());
  148 + hor.n());
148 149 }
149 150  
150 151 vec<float>
... ... @@ -212,6 +213,13 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
212 213 std::cout << position[0] << "," << position[1] << "," << position[1]
213 214 << std::endl;
214 215 setPosition(direction*magnitude[1]+position);
  216 + vec<float> Y(1.0,0.0,0.0);
  217 + if(cos(Y.dot(direction))< 0.087){
  218 + Y[0] = 0.0; Y[1] = 1.0;}
  219 + hor = stim::rect<float>(magnitude, position, direction.norm(),
  220 + ((Y.cross(direction)).cross(direction)).norm());
  221 + ver = stim::rect<float>(magnitude, position, direction.norm(),
  222 + hor.n());
215 223 std::cout << position[0] << "," << position[1] << "," << position[1]
216 224 << std::endl;
217 225  
... ...