texture mapping

i posted a question about drawing an egg, i got that part working now i am stuck with the texture mapping part.

this is the code i am trying to initialize the texture coordinate.

for(int longVertCount=0; longVertCount<NUM_LONGITUDINAL_VERTICES; longVertCount++){ // along z axis
	for(int circumVertCount=0; circumVertCount<NUM_CIRCUMFERENTIALL_VERTICES; circumVertCount++){ // x and y
		a = (float)longVertCount/(float) (NUM_LONGITUDINAL_VERTICES);
		b = (float)circumVertCount / (float)(NUM_CIRCUMFERENTIALL_VERTICES);
		texture_coordinates[longVertCount][circumVertCount][1] =  a*basketRadius;
		texture_coordinates[longVertCount][circumVertCount][0] =  b*basketHeight;

and this is the code for drawing the texture

for(int longVertCount=0; longVertCount<NUM_LONGITUDINAL_VERTICES-1; longVertCount++){ // along z axis
	for(int circumVertCount=0; circumVertCount<NUM_CIRCUMFERENTIALL_VERTICES; circumVertCount++){

but my texture mapping is wrong. any help??

Verify the range of your texture coordinates. It must be between
[0 1] if you don’t want the texture to repeat on your egg. Because you multiply by basketRadius and basketHeight, I suspect that it is not the case.

Beware that you try to map a square texture on an egg, so expect some texture deformation and/or artifact on it (unless you have generated your texture for this kind of mapping).