   A Height Map artifact
  I have been working on height maps for a bit now and got to working. The only thing is I get a wird artifact when i render it. Everything is fine except for one end of the height map has some polygons that shoot stright down. what i mean is its rendering at a certain height then the next vertex drops by 30 for no apparent reason. Not sure if anyone can help me with this or not, hopeing someone ran into this problem befor and can help me out. Will list my render code below. The Height map is 512 * 512.void Terrain::RenderByBruteForce(void) {if(HeightData == NULL) {return;}//end HeightData == NULL ifif(WidthX == 0) {return;}//end WidthX || WidthZ ifif(WidthZ == 0) {return;}//end WidthX || WidthZ iffloat Xvalue, Zvalue, Xplusscalevalue;int x, z;for(x =  0; x < WidthX - 3; x += DetailScale) {glBegin(GL_TRIANGLE_STRIP);for(z = 0; z < WidthZ - 1; z += DetailScale) {Xvalue = (float)x/WidthX;Zvalue = (float)z/WidthZ;Xplusscalevalue = (float)(x + DetailScale)/WidthX;glTexCoord2f(Xvalue, Zvalue);glVertex3f((float)x, GetHeight(x, z), (float)z);glTexCoord2f(Xplusscalevalue, Zvalue);glVertex3f((float)(x + DetailScale), GetHeight((x + DetailScale), z), (float)z);}//end z forglEnd();}//end x for}//end RenderByBruteForceediting it to include a screen shot, not a great one.
  Look at this part of your code:for(z = 0; z < WidthZ - 1; z += DetailScale)//it probably should be:for(z = 0; z < WidthZ - 3; z += DetailScale)And if that doesn't work either, you might just set the area being drawn to 511x511, that caused the same error in my engine once.   ;  thx that got it working   