{"id":4050,"date":"2018-05-02T21:37:17","date_gmt":"2018-05-02T13:37:17","guid":{"rendered":"http:\/\/www.bookcard.net\/wordpress\/?p=4050"},"modified":"2018-10-14T21:19:10","modified_gmt":"2018-10-14T13:19:10","slug":"opengl_quadric","status":"publish","type":"post","link":"https:\/\/www.bookcard.net\/wordpress\/opengl_quadric\/","title":{"rendered":"OpenGL\u4e4b\u4e8c\u6b21\u66f2\u9762"},"content":{"rendered":"<figure id=\"attachment_4051\" aria-describedby=\"caption-attachment-4051\" style=\"width: 1024px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2018\/05\/OpenGL_Quadric.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-4051\" src=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2018\/05\/OpenGL_Quadric.jpg\" alt=\"\" width=\"1024\" height=\"768\" srcset=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2018\/05\/OpenGL_Quadric.jpg 1024w, https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2018\/05\/OpenGL_Quadric-300x225.jpg 300w, https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2018\/05\/OpenGL_Quadric-768x576.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption id=\"caption-attachment-4051\" class=\"wp-caption-text\">OpenGL\u4e4b\u4e8c\u6b21\u66f2\u9762<\/figcaption><\/figure>\n<p>\u5982\u679c\u8981\u7e6a\u88fd\u300e\u7403\u9ad4\u300f,\u300e\u5713\u67f1\u300f,\u300e\u5713\u9310\u300f,\u300e\u5713\u76e4\u300f\u9664\u4e86\u53ef\u4ee5\u81ea\u5df2\u7de8\u5beb\u5716\u5f62\u5eab.\u9084\u53ef\u4ee5\u6642\u7528OpenGL Utility Library(OpenGL\u5be6\u7528\u5eab)\u63d0\u4f9b\u7684\u9ad8\u7d1a\u5716\u5f62\u652f\u6301.\u7c21\u7a31\u70baGLUT.\u8981\u4e0b\u8f09\u53ef\u5230\u5b98\u7db2\u4e0b\u8f09: <a href=\"https:\/\/www.opengl.org\/resources\/libraries\/glut\/glutdlls37beta.zip\">https:\/\/www.opengl.org\/resources\/libraries\/glut\/glutdlls37beta.zip<\/a> \u4f46windows\u7248\u53ea\u652f\u6301x86.\u6f14\u793a\u7a0b\u5f0f:<a href=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2018\/05\/OpenGLQuadric.zip\">\u4e0b\u8f09<\/a><\/p>\n<p>1.\u5275\u5efa\u4e8c\u6b21\u66f2\u9762\u5c0d\u8c61,\u6210\u529f\u8fd4\u56de\u6307\u5411\u4e8c\u6b21\u66f2\u9762\u7684\u6307\u91dd,\u5426\u5247\u8fd4\u56deNULL<\/p>\n<p>GLUquadric*gluNewQuadric(void);<\/p>\n<p>2.\u8a2d\u7f6e\u7e6a\u88fd\u98a8\u683c<\/p>\n<p>void gluQuadricDrawStyle(GLUquadric *quadObject,GLenum drawStyle);<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"277\">drawStyle(\u7e6a\u756b\u6a23\u5f0f)<\/td>\n<td width=\"277\">\u7c21\u4ecb<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>GLU_FILL<\/strong><\/td>\n<td width=\"277\">\u5be6\u9ad4\u586b\u5145\u6e32\u67d3<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>GLU_LINE<\/strong><\/td>\n<td width=\"277\">\u4ee5\u7dda\u6846\u6a21\u5f0f\u6e32\u67d3<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>GLU_SILHOUETTE<\/strong><\/td>\n<td width=\"277\">\u4ee5\u8f2a\u6846\u6a21\u5f0f\u6e32\u67d3,\u6392\u9664\u591a\u908a\u5f62\u7684\u5171\u7dda.<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>GLU_POINT<\/strong><\/td>\n<td width=\"277\">\u4ee5\u9802\u9ede\u6a21\u5f0f\u6e32\u67d3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>3.\u8a2d\u7f6e\u6cd5\u7dda\u751f\u6210<\/p>\n<p>\u6cd5\u7dda\u72c0\u614b\u7528\u65bc\u8a2d\u7f6e\u4e8c\u6b21\u66f2\u9762\u7684\u8868\u9762\u6cd5\u7dda\u7684\u751f\u6210\u65b9\u5f0f.<\/p>\n<p>void WINAPI gluQuadricNormals(GLUquadric *quadObject,GLenum normals);<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"255\">Normals(\u6cd5\u7dda\u72c0\u614b)<\/td>\n<td width=\"298\">\u7c21\u4ecb<\/td>\n<\/tr>\n<tr>\n<td width=\"255\"><strong>GLU_NONE<\/strong><\/td>\n<td width=\"298\">\u4e0d\u751f\u6210\u6cd5\u7dda<\/td>\n<\/tr>\n<tr>\n<td width=\"255\"><strong>GLU_FLAT<\/strong><\/td>\n<td width=\"298\">\u6bcf\u500b\u591a\u908a\u5f62\u751f\u6210\u4e00\u500b\u6cd5\u7dda(\u55ae\u8abf\u660e\u6697\u8655\u7406)<\/td>\n<\/tr>\n<tr>\n<td width=\"255\"><strong>GLU_SMOOTH<\/strong><\/td>\n<td width=\"298\">\u6bcf\u500b\u9802\u9ede\u751f\u6210\u4e00\u500b\u6cd5\u7dda(\u5e73\u6ed1\u660e\u6697\u8655\u7406) (\u9ed8\u8a8d\u503c)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>3.\u8a2d\u7f6e\u6cd5\u7dda\u65b9\u5411<\/p>\n<p>\u8a2d\u7f6e\u751f\u6210\u6cd5\u7dda\u7684\u65b9\u5411,\u5167\u90e8\u9084\u662f\u5916\u90e8.<\/p>\n<p>Void gluQuadricOrientation(GLUquadric *quadObject,GLenum orientation);<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"277\">Orientation(\u65b9\u5411)<\/td>\n<td width=\"277\">\u7c21\u4ecb<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>GLU_OUTSIDE<\/strong><\/td>\n<td width=\"277\">\u6cd5\u7dda\u6307\u5411\u5916\u5074(\u9ed8\u8a8d\u503c)<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>GLU_INSIDE<\/strong><\/td>\n<td width=\"277\">\u6cd5\u7dda\u6307\u5411\u5167\u5074<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>4.\u8a2d\u7f6e\u7d0b\u7406\u5ea7\u6a19<\/p>\n<p>\u7d0b\u7406\u72c0\u614b\u662f\u5426\u70ba\u5716\u5f62\u751f\u6210\u7d0b\u7406\u5ea7\u6a19<\/p>\n<p>void gluQuadricTexture(GLUquadric *quadObject,GLboolean textureCoords);<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"277\">textureCoords<\/td>\n<td width=\"277\">\u7c21\u4ecb<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>GL_TRUE<\/strong><\/td>\n<td width=\"277\">\u751f\u6210\u7d0b\u7406\u5ea7\u6a19<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>GL_FALSE<\/strong><\/td>\n<td width=\"277\">\u4e0d\u751f\u6210\u7d0b\u7406\u5ea7\u6a19(\u9ed8\u8a8d\u503c)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>5.\u7576\u4e0d\u4f7f\u7528\u4e8c\u6b21\u66f2\u9762\u5f8c\u9700\u8981\u91cb\u653e\u8cc7\u6e90<\/p>\n<p>void gluDeleteQuadric(GLUquadricObj *state);<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u4e8c\u6b21\u66f2\u9762\u7e6a\u756b<\/strong><\/p>\n<p>1.\u7e6a\u756b\u504f\u5e73\u7684\u5713\u76e4,\u4e2d\u9593\u53ef\u4ee5\u6709\u500b\u5713\u5b54<\/p>\n<p>void gluDisk(GLUquadric *qobj,GLdouble innerRadius,GLdouble outerRadius,GLint slices,GLint loops);<\/p>\n<p>\u7e6a\u756b\u504f\u5e73\u7684\u6247\u5f62\u5713\u76e4<\/p>\n<p>void gluPartialDisk(GLUquadric *qobj,GLdouble innerRadius,GLdouble outerRadius,GLint slices,GLint loops,GLdouble startAngle,GLdouble sweepAngle);<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"277\">\u53c3\u6578<\/td>\n<td width=\"277\">\u7c21\u4ecb<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>qobj<\/strong><\/td>\n<td width=\"277\">\u4e8c\u6b21\u66f2\u9762\u5c0d\u8c61<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>innerRadius<\/strong><\/td>\n<td width=\"277\">\u5167\u5713\u76f4\u5f91,\u82e5\u70ba0\u5247\u662f\u9589\u5b54,\u5927\u65bc\u96f6\u5247\u4e2d\u5fc3\u6709\u500b\u5b54<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>outerRadius<\/strong><\/td>\n<td width=\"277\">\u5916\u5713\u76f4\u5f91<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>Slices<\/strong><\/td>\n<td width=\"277\">\u7e5ez\u8ef8\u7684\u7d30\u5206\u6578.\u6b64\u503c\u8d8a\u5927\u5713\u76e4\u8d8a\u5713<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>Loops<\/strong><\/td>\n<td width=\"277\">\u540c\u8ef8\u5713\u76e4\u7684\u908a\u5f62\u7d30\u5206\u6578<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>startAngle<\/strong><\/td>\n<td width=\"277\">\u6247\u5f62\u8d77\u6b64\u89d2\u5ea6<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>sweepAngle<\/strong><\/td>\n<td width=\"277\">\u6247\u5f62\u5713\u5f27\u89d2\u5ea6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>2.\u7e6a\u756b\u5713\u9310\u548c\u5713\u67f1<\/p>\n<p>void gluCylinder(GLUquadric *qobj,GLdouble baseRadius,GLdouble topRadius,GLdouble height,GLint slices,GLint stacks);<\/p>\n<p>\u5206\u5225\u6709\u5e95\u5ea7\u534a\u5f91\u8207\u67f1\u9802\u534a\u5f91\u82e5\u5176\u4e00\u70ba0\u70ba\u5713\u9310,\u82e5\u5169\u503c\u4e0d\u76f8\u7b49\u5247\u70ba\u9310\u5f62\u5713\u67f1,\u82e5\u5169\u503c\u76f8\u7b49\u5247\u70ba\u5713\u67f1. \u5e95\u5ea7\u5713\u9762\u8207\u67f1\u9802\u5713\u9762\u662f\u7e6a\u756b\u7684,\u4f60\u9700\u8981\u4f7f\u7528gluDisk()\u53e6\u5916\u7e6a\u756b<\/p>\n<p>\u5713\u67f1\u6cbfZ\u8ef8\u7e6a\u756b,\u5e95\u5ea7\u70ba\u65bcZ=0, \u67f1\u9802\u4f4d\u65bcZ=height(\u9ad8\u5ea6)<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"277\">\u53c3\u6578<\/td>\n<td width=\"277\">\u7c21\u4ecb<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>qobj<\/strong><\/td>\n<td width=\"277\">\u4e8c\u6b21\u66f2\u9762\u5c0d\u8c61<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>baseRadius<\/strong><\/td>\n<td width=\"277\">\u5e95\u5ea7\u534a\u5f91 z=0<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>topRadius<\/strong><\/td>\n<td width=\"277\">\u67f1\u9802\u534a\u5f91z=height<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>height<\/strong><\/td>\n<td width=\"277\">\u5713\u67f1\u7684\u9ad8\u5ea6<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>slices<\/strong><\/td>\n<td width=\"277\">\u7e5eZ\u8ef8\u7684\u7d30\u5206\u6578.\u6b64\u503c\u8d8a\u5927\u5713\u67f1\u8d8a\u5713<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>stacks<\/strong><\/td>\n<td width=\"277\">\u5ef6Z\u8ef8\u7684\u7d30\u5206\u6578.\u6b64\u503c\u8d8a\u9ad8\u8fd4\u5c04\u5149\u7684\u6548\u679c\u8d8a\u597d.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>3.\u7e6a\u756b\u7403\u9ad4,\u6309\u7d66\u5b9a\u534a\u5f91\u4ee5\u539f\u9ede\u70ba\u4e2d\u5fc3\u9032\u884c\u7e6a\u88fd<\/p>\n<p>void gluSphere(GLUquadric *qobj,GLdouble radius,Glint slices,GLint stacks);<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"277\">\u53c3\u6578<\/td>\n<td width=\"277\">\u7c21\u4ecb<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>qobj<\/strong><\/td>\n<td width=\"277\">\u4e8c\u6b21\u66f2\u9762\u5c0d\u8c61<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>radius<\/strong><\/td>\n<td width=\"277\">\u7403\u9ad4\u7684\u534a\u5f91<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>slices<\/strong><\/td>\n<td width=\"277\">\u7e5ez\u8ef8\u7684\u7d30\u5206\u6578(\u76f8\u7576\u65bc\u7d93\u7dda)<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>stacks<\/strong><\/td>\n<td width=\"277\">\u6cbfz\u8ef8\u7684\u7d30\u5206\u6578(\u76f8\u7576\u65bc\u7def\u7dda)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u8981\u7e6a\u88fd\u300e\u7403\u9ad4\u300f,\u300e\u5713\u67f1\u300f,\u300e\u5713\u9310\u300f,\u300e\u5713\u76e4\u300f\u9664\u4e86\u53ef\u4ee5\u81ea\u5df2\u7de8\u5beb\u5716\u5f62\u5eab.\u9084\u53ef\u4ee5\u6642\u7528OpenGL Utility &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.bookcard.net\/wordpress\/opengl_quadric\/\" class=\"more-link\">\u7e7c\u7e8c\u95b1\u8b80 <span class=\"screen-reader-text\">OpenGL\u4e4b\u4e8c\u6b21\u66f2\u9762<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62],"tags":[50],"class_list":["post-4050","post","type-post","status-publish","format-standard","hentry","category-opengl","tag-opengl","entry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/4050","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/comments?post=4050"}],"version-history":[{"count":1,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/4050\/revisions"}],"predecessor-version":[{"id":4053,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/4050\/revisions\/4053"}],"wp:attachment":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/media?parent=4050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/categories?post=4050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/tags?post=4050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}