View Full Version : a gluDisk with a black boundary
04-22-2005, 12:05 PM
I need to draw a yellow disk with a black boundary. A simple way is to draw a yellow disk first then draw a black disk which has very close inner and outer rads. The second disk serves as a close loop around the first disk. Is there a better way to do it? Thanks.
04-22-2005, 02:30 PM
That's probably an OK method.
If you draw the black disk first it will behave better with no zbuffer and other coplanar situations. Using glPolygonOffset for the second disk would also help with zbuffering to make it generally robust I think.
A better way for lots of these might be to draw a textured quad with a circular shaped texture including the black outline, or draw a disc and a ring yourself.
Start writing your own drawing code instead of relying on glut primitive rendering stuff, you'll learn more and be able to do things efficiently without relying on the limitations of GLUT's primitives. Glut primitives are just there to allow neophytes to get something interesting on the screen easily for testing & tutorials, you're not supposed to use them for real rendering. When you start trying to enhance the appearance of something glut renders by drawing multiple GLUT primitives you can be pretty sure you've wandered off the reservation.
You can draw a second disk and ask to draw only the quadric's silhouette. Check out gluQuadricDrawStyle.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.