Commit 98498cfa1d57c5d8f46273414a72aeaadc3c66bf
1 parent
13c2a7d4
Fixed Step() function
Showing
1 changed file
with
11 additions
and
5 deletions
Show diff stats
gl/gl_spider.h
... | ... | @@ -101,8 +101,8 @@ class gl_spider : public virtual gl_texture<T> |
101 | 101 | ver = stim::rect<float>(position, direction, (Y.cross(direction)).norm()); |
102 | 102 | ver.scale(magnitude[0], magnitude[1]); |
103 | 103 | */ |
104 | - hor = stim::rect<float>(magnitude, position, direction, Y); | |
105 | - ver = stim::rect<float>(magnitude, position, direction, | |
104 | + hor = stim::rect<float>(magnitude, position, direction.norm(), Y); | |
105 | + ver = stim::rect<float>(magnitude, position, direction.norm(), | |
106 | 106 | (Y.cross(direction)).norm()); |
107 | 107 | } |
108 | 108 | |
... | ... | @@ -121,8 +121,8 @@ class gl_spider : public virtual gl_texture<T> |
121 | 121 | ver = stim::rect<float>(position, direction, (Y.cross(direction)).norm()); |
122 | 122 | ver.scale(magnitude[0], magnitude[1]); |
123 | 123 | */ |
124 | - hor = stim::rect<float>(magnitude, position, direction, Y); | |
125 | - ver = stim::rect<float>(magnitude, position, direction, | |
124 | + hor = stim::rect<float>(magnitude, position, direction.norm(), Y); | |
125 | + ver = stim::rect<float>(magnitude, position, direction.norm(), | |
126 | 126 | (Y.cross(direction)).norm()); |
127 | 127 | } |
128 | 128 | //temporary cost for convenience. |
... | ... | @@ -142,7 +142,7 @@ 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(), Y.norm()); | |
146 | 146 | ver = stim::rect<float>(magnitude, position, direction.norm(), |
147 | 147 | (Y.cross(direction)).norm()); |
148 | 148 | } |
... | ... | @@ -212,6 +212,12 @@ class gl_spider : public virtual gl_texture<T> |
212 | 212 | std::cout << position[0] << "," << position[1] << "," << position[1] |
213 | 213 | << std::endl; |
214 | 214 | setPosition(direction*magnitude[1]+position); |
215 | + vec<float> Y(1.0,0.0,0.0); | |
216 | + if(cos(Y.dot(direction))< 0.087){ | |
217 | + Y[0] = 0.0; Y[1] = 1.0;} | |
218 | + hor = stim::rect<float>(magnitude, position, direction.norm(), Y); | |
219 | + ver = stim::rect<float>(magnitude, position, direction.norm(), | |
220 | + (Y.cross(direction)).norm()); | |
215 | 221 | std::cout << position[0] << "," << position[1] << "," << position[1] |
216 | 222 | << std::endl; |
217 | 223 | ... | ... |
-
mentioned in commit 2dbd88bd02065df7f76f7bf9c3b5eca09891fbc6