Original Post
Hi current, I have a array of sphere created using glSolidSphere and it is lined up in a line with no gaps between each of the sphere. So far so good, I can see the result I got. but as I try to rotate the sphere, the line of sphere moves but then gaps were started to show up between sphere. each of the gaps between the spheres start to increase as it reach at the end of the lines of spheres. before: OOOOOOOO (lines of sphere) after: O O O O O this is the code that I use to rotate the lines of sphere, I keep reading through but still cannot find anything wrong with it.can anyone give me some suggestion
float tempX = 0;
float tempY = 0;
float updateX;
float updateY;
for(int i = 0; i < 10; i++){
objects sphere = lowerLegArray;
tempX = sphere.getLocationX();
tempY = sphere.getLocationY();
updateX = cos((float)0.1) * tempX - sin((float)0.1) * tempY;
updateY = sin((float)0.1) * tempX + cos((float)0.1) * tempY;
glPopMatrix();
glTranslatef(updateX, updateY, 0);
glTranslatef(tempX, tempY, 0);
sphere.sphere();
glPopMatrix();
lowerLegArray.setLocation(updateX, updateY);
}
thx for all the help