glutSolidSphere

Started by
7 comments, last by ceylan 15 years, 9 months ago
can't we put glutSolidSphere function in a "for loop" :S i tried but it says "program is not responding" :S error is about glutSolidSphere,because when i write the same code by using glVertex instead of glutSolidSphere,it works:S
♥Türkiye♥
Advertisement
Please don't overpunctuate your subject line.
show more code
Yeah, show your code. I did a quick test since I'm a bit rusty with OpenGL and it worked fine for me.
while (!feof ( file ) )
{
fscanf(file,"%lf%lf%lf%",&ko.x,&ko.y,&ko.z);


glColor3f(0,1,0);

glLoadIdentity();
glTranslatef(ko.x,ko.y,ko.z);
glutSolidSphere(1,25,25);
}
fclose(file);

glutSwapBuffers();




// ko means coordinate :D
♥Türkiye♥
Try verifying what values you're reading from your file. That code is pretty odd. Why would you only want to render the spheres one frame? Or do you read from a file every frame?
Also gluSolidSphere is quite slow so it will slow down your application MUCH more than a single glVertex call.
If I was helpful, feel free to rate me up ;)If I wasn't and you feel to rate me down, please let me know why!
i am an intern and it's my first opengl experience. it's normal if my code is odd :D


when i use vertexes instead of spheres,there is no difference between x-y graph and x-y-z graph. but sphere doesn't work. i don't know what to do :(
♥Türkiye♥
why are my x-y-z and x-y graphs the same :'(
♥Türkiye♥

This topic is closed to new replies.

Advertisement