188 |
glVertex(transform(p)); |
glVertex(transform(p)); |
189 |
} |
} |
190 |
virtual ZPt transform(const ZPt &p) const { |
virtual ZPt transform(const ZPt &p) const { |
191 |
return lerp(cs1->transform(p), |
ZPt res = lerp(cs1->transform(p), |
192 |
cs2->transform(p), |
cs2->transform(p), |
193 |
fract); |
fract); |
194 |
|
DBG(dbg) << "PointInterp: "<<p<<": "<<fract<<" "<< |
195 |
|
cs1->transform(p) << " " << cs2->transform(p) << " " |
196 |
|
<< res<<"\n"; |
197 |
|
return res; |
198 |
} |
} |
199 |
virtual float nonlinearity(const ZPt &p, float radius) { |
virtual float nonlinearity(const ZPt &p, float radius) { |
200 |
return lerp(cs1->nonlinearity(p, radius), |
return lerp(cs1->nonlinearity(p, radius), |
227 |
cs2->performGL(); |
cs2->performGL(); |
228 |
glGetFloatv(GL_MODELVIEW_MATRIX, mat2); |
glGetFloatv(GL_MODELVIEW_MATRIX, mat2); |
229 |
|
|
230 |
|
DBG(dbg) << "PointInterp PerformGL!\n"; |
231 |
|
if(dbg) { |
232 |
|
for(int i=0; i<16; i++) DBG(dbg) << mat1[i] << " "; |
233 |
|
DBG(dbg) << "\n"; |
234 |
|
for(int i=0; i<16; i++) DBG(dbg) << mat2[i] << " "; |
235 |
|
DBG(dbg) << "\n"; |
236 |
|
} |
237 |
for(int i=0; i<16; i++) mat1[i] = lerp(mat1[i], mat2[i], fract); |
for(int i=0; i<16; i++) mat1[i] = lerp(mat1[i], mat2[i], fract); |
238 |
|
if(dbg) { |
239 |
|
for(int i=0; i<16; i++) DBG(dbg) << mat1[i] << " "; |
240 |
|
DBG(dbg) << "\n"; |
241 |
|
} |
242 |
|
|
243 |
|
|
244 |
glPopMatrix(); |
glPopMatrix(); |
1240 |
for(int i=0; i<nprev; i++) { |
for(int i=0; i<nprev; i++) { |
1241 |
int par1 = inds1[cs1+1+i]; |
int par1 = inds1[cs1+1+i]; |
1242 |
if(!cs[par1]) return false; |
if(!cs[par1]) return false; |
|
int par2 = inds1[cs2+1+i]; |
|
1243 |
if(par1 >= interpinds[0]) return false; |
if(par1 >= interpinds[0]) return false; |
1244 |
if(interpinds[par1] != par2) return false; |
int par2 = inds2[cs2+1+i]; |
1245 |
|
int par1interpsto = (par1 > 0 ? interpinds[par1] : 0); |
1246 |
|
if(par1interpsto != par2) return false; |
1247 |
} |
} |
1248 |
DBG(dbg) << "DO interpolate\n"; |
DBG(dbg) << "DO interpolate\n"; |
1249 |
return true; |
return true; |