The problem was/is a little embarrassing... it was basically me putting code in the wrong spot. I found it on the train this morning:daan wrote:I would be interested to know what resolves your trouble.
Code: Select all
for (i=0; i<4; i++) { [B]// FOR THE FOUR VERTICES OF QUAD.[/B]
[B]// disk coordinates[/B]
p_d[n].x = b2[i] * cos(a2[i]) + x0;
p_d[n].y = b2[i] * sin(a2[i]) + y0;
[B]// calcuate texture coordinates[/B]
AziCalc (lat_p, long_p, b2[i], a2[i], p_d[n].x, R);
p_d[n].u = 0.5 - longitude/PI2;
p_d[n].v = latitude/PI;
[B]// I HAD THE TEXTURE WRAPPING CODE HERE![/B]
n++;
}
[B]// THE CODE WHOULD HAVE BEEN HERE![/B]
// Wrap bad texture coordinates
getmax2(n-4, n-1, &max, &index); //get max value for last quad
getmin2(n-4, n-1, &min, &index); //get min value for last quad
while (max - min > 0.5){ // if texture coordinates too far apart
p_d[index].u += 1; //wrap coordinates
getmax2(n-4, n-1, &min, &index); //get max value for last quad
getmin2(n-4, n-1, &min, &index); //get min value for last quad
}
}
(I compiled this version as 'Release' as this should hopfully get rid of some dll dependencies - not sure though)
I wanted to thank you dann for the help you have given me. Hopfully you like the program!Controls:
Arrow Keys: Adjust the centre of projection
'T': toggles the texture
'F': changes filters