newbie q : y still sphere?


#1

this is my code
i think i suppose to receive the ellipsoid not the sphere
however, after the output ot the screen.

no matter wat number i change, the only output i receive is perfect sphere
Y?

thx XD
Tom


void dE(double r1, double r2, double r3)
{
glBegin (GL_POLYGON);

glMatrixMode(GL_MODELVIEW);
//glLoadIdentity();

glTranslatef( 2.0, 0.0, 0.0 );
glScalef(2.0, -0.5, 40.0);
glutSolidSphere( 1.0, 10, 10 );

glEnd();

}


#2

I wonder if glutSolidSphere plays with the transform matrix? Try making a sphere with your own code and see if that works.


#3

Yup, GLUT does indeed screw around with the transform stack in order to draw its primitives… I would have thought your code should still work tho…


#4

This code is not correct. You cannot call glMatrixMode, glTranslate or whatever in a glBegin / glEnd pair.


#5

Good catch, that’s probably it. Get rid of the glBegin and glEnd, I’m sure the GLUT functions call them internally.


#6

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.