Jump to content
  • Advertisement
Sign in to follow this  
ceylan

glutSolidSphere

This topic is 3638 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
Yeah, show your code. I did a quick test since I'm a bit rusty with OpenGL and it worked fine for me.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Also gluSolidSphere is quite slow so it will slow down your application MUCH more than a single glVertex call.

Share this post


Link to post
Share on other sites
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 :(

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!