ptitSeb
Serial Porter
Ok, Found it. In fact it was a precision issue with the texture!
Texture is set to GL_REPEAT.
Legacy code was:
//glBegin(GL_QUADS);
glTexCoord2f(0, -pos / 128.0F);
glVertex3f(r_cx2, r_cy2, r_z);
glTexCoord2f(1, -pos / 128.0F);
glVertex3f(r_x2, r_y2, r_z);
glTexCoord2f(1, -(pos + inc) / 128.0F);
glVertex3f(r_x2[i + 1], r_y2[i + 1], r_z[i + 1]);
glTexCoord2f(0, -(pos + inc) / 128.0F);
glVertex3f(r_cx2[i + 1], r_cy2[i + 1], r_z[i + 1]);
//glEnd();
(don't mind the glBegin and glEnd() in comment, I converted to GLES and optimise many things, but the quad definition stay the same)
By putting this:
//glBegin(GL_QUADS);
int p = pos;
p=p%128;
glTexCoord2f(0, -p / 128.0F);
glVertex3f(r_cx1, r_cy1, r_z);
glTexCoord2f(1, -p / 128.0F);
glVertex3f(r_x1, r_y1, r_z);
glTexCoord2f(1, -(p + inc) / 128.0F);
glVertex3f(r_x1[i + 1], r_y1[i + 1], r_z[i + 1]);
glTexCoord2f(0, -(p + inc) / 128.0F);
glVertex3f(r_cx1[i + 1], r_cy1[i + 1], r_z[i + 1]);
//glEnd();
It works!
Look at the picture, I have done the main road and right side. Left side is still old code (to see the difference)
Texture is set to GL_REPEAT.
Legacy code was:
//glBegin(GL_QUADS);
glTexCoord2f(0, -pos / 128.0F);
glVertex3f(r_cx2, r_cy2, r_z);
glTexCoord2f(1, -pos / 128.0F);
glVertex3f(r_x2, r_y2, r_z);
glTexCoord2f(1, -(pos + inc) / 128.0F);
glVertex3f(r_x2[i + 1], r_y2[i + 1], r_z[i + 1]);
glTexCoord2f(0, -(pos + inc) / 128.0F);
glVertex3f(r_cx2[i + 1], r_cy2[i + 1], r_z[i + 1]);
//glEnd();
(don't mind the glBegin and glEnd() in comment, I converted to GLES and optimise many things, but the quad definition stay the same)
By putting this:
//glBegin(GL_QUADS);
int p = pos;
p=p%128;
glTexCoord2f(0, -p / 128.0F);
glVertex3f(r_cx1, r_cy1, r_z);
glTexCoord2f(1, -p / 128.0F);
glVertex3f(r_x1, r_y1, r_z);
glTexCoord2f(1, -(p + inc) / 128.0F);
glVertex3f(r_x1[i + 1], r_y1[i + 1], r_z[i + 1]);
glTexCoord2f(0, -(p + inc) / 128.0F);
glVertex3f(r_cx1[i + 1], r_cy1[i + 1], r_z[i + 1]);
//glEnd();
It works!
Look at the picture, I have done the main road and right side. Left side is still old code (to see the difference)