Hey i want to draw a half egg in opengl (it a basket)
the egg should be hollow not solid.
this is my code when i draw this i get half hollow and half filled.
any help??
double x,y,z,r;
for(int longCount=0; longCount<NUM_LONGITUDINAL_VERTICES; longCount++){ // along z axis
for(int latCount=0; latCount<NUM_CIRCUMFERENTIALL_VERTICES; latCount++){ // x and y
z = sin(Pi*latCount/((double) (NUM_CIRCUMFERENTIALL_VERTICES-1))-Pi/2.0f);
r = cos(Pi*latCount/((double) (NUM_CIRCUMFERENTIALL_VERTICES-1))-Pi/2.0f);
x = (cos(Pi*longCount/(double) (NUM_LONGITUDINAL_VERTICES-1))*r);
y = (sin(Pi*longCount/(double) (NUM_LONGITUDINAL_VERTICES-1))*r);
vertices[longCount][latCount][0] = x; //x
vertices[longCount][latCount][1] = y; //y
vertices[longCount][latCount][2] = z; //z
}
}