Hi. I'm having a problem making an animation of the cylider drawn with quadrics.
It draws it fine but it will not move. I previously did some animation using glutSphere and glutCube objects and there was no problem. What am I doing wrong here? This is my function in which I draw the cylinder(with top and bottom discs closing it). I'll appreciate any hints.
Without getting to deep into code (btw, use the code tags please) - you have 4 matrixes pushes and 3 pops (one missing after gluDisk). That might be your problem (and you would get a stack overflow error if you'd use glGetError and gluErrorString - error handling is a good idea in general).
No it didn't and I just worked it out. I tried to copy and paste this code to my program where I was animating the cubes and spheres and it did work there. So I figured out what was the difference, but I it makes no sense to me.
This is how I count time elapsed:
const double t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
const double s = t*60.0;
And I have it declared globally. But in this case, I also copied that 2 lines into my drawCylinder() function and it made it work.
So basically, I have the same thing declared twice in my code (once globally and once inside a function). And I can not remove the one declared globally as I need it in other functions, that have no problems using it...