PDA

View Full Version : Help drawing a disk



tip
02-14-2005, 02:25 PM
Can anyone help me draw a disk given the center (x,y,z) and the radius?

zukko
02-14-2005, 04:43 PM
use quadratics. for a disk it would be:

gluDisk(quadratic,inner_radius,outter_radius,subdi vitions,subdivitions);

tip
02-14-2005, 06:26 PM
Thanks, I can now draw the disk, but it is not positioned correctly. My center is (10.0,20.0,2.0) and the radius is 2.0.

I used the following code:
gluDisk(quadratic,0.0,2.0,10.0,20.0);

Please assist.

Thanks

mikael_aronsson
02-15-2005, 12:43 AM
Have a peek at any OpenGL tutorial, it will explain how to do transformations, glTranslate() will come handy.

You also need to have a look at the gluDisk parameters, it has no information about position so you cannot specify it, you specify inner/outer radius and the number of triangles to us to create the disk.

Use glTranslate before calling gluDisk to set the position.

Mikael