PDA

View Full Version : Question about gluDisk



anuchka
07-22-2004, 02:28 AM
Hi

I'm trying to draw the circle with gluDisk in 3d space,but it looks oval(it is streched in vertical
direction),but I need the circle and not oval disk,how to fix it?
My code is this:

GLUquadricObj* quadratic;
quadratic = gluNewQuadric();
gluQuadricNormals(quadratic, GLU_SMOOTH);
glPushMatrix();
glTranslatef(xc,yc,zc);
gluDisk(quadratic,0,radius,32,32);
glPopMatrix();

-NiCo-
07-22-2004, 04:50 AM
First: are you looking along a viewing direction perpendicular to the disk?

Second: make sure your projection matrix corresponds to your GLwindow size.

eg. if you set glortho(0,800,0,600,..) and you have a viewport of 400x600 instead of 800x600, then your disk will be stretched in the vertical direction. This also applies to perspective projections.

Greetz,

Nico

anuchka
07-22-2004, 05:06 AM
Thank you,it's fix now.
(I added vote... )