{"id":3580,"date":"2018-01-14T21:08:43","date_gmt":"2018-01-14T13:08:43","guid":{"rendered":"http:\/\/www.bookcard.net\/wordpress\/?p=3580"},"modified":"2018-10-14T21:30:21","modified_gmt":"2018-10-14T13:30:21","slug":"opengl_matrix","status":"publish","type":"post","link":"https:\/\/www.bookcard.net\/wordpress\/opengl_matrix\/","title":{"rendered":"OpenGL\u4e4b\u77e9\u9663"},"content":{"rendered":"<figure id=\"attachment_3583\" aria-describedby=\"caption-attachment-3583\" style=\"width: 1024px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2018\/01\/OpenGL_Matrix.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3583\" src=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2018\/01\/OpenGL_Matrix.jpg\" alt=\"\" width=\"1024\" height=\"768\" srcset=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2018\/01\/OpenGL_Matrix.jpg 1024w, https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2018\/01\/OpenGL_Matrix-300x225.jpg 300w, https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2018\/01\/OpenGL_Matrix-768x576.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption id=\"caption-attachment-3583\" class=\"wp-caption-text\">OpenGL\u4e4b\u77e9\u9663<\/figcaption><\/figure>\n<p>OpenGL\u7684\u8b8a\u63db\u904b\u7b97\u5747\u4f7f\u75284&#215;4\u77e9\u9663\u9032\u884c.OpenGL\u4f7f\u7528\u5806\u68e7\u4fdd\u5b58\u77e9\u9663.\u5404\u7a2e\u8b8a\u63db\u904b\u7b97\u5747\u91dd\u5c0d\u68e7\u9802\u9032\u884c\u64cd\u4f5c.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"284\">\u77e9\u9663<\/td>\n<td width=\"284\">\u7c21\u4ecb<\/td>\n<\/tr>\n<tr>\n<td width=\"284\">void glMatrixMode (GLenum mode);<\/td>\n<td width=\"284\">\u8a2d\u5b9a\u7576\u524d\u77e9\u9663\u5806\u68e7<\/td>\n<\/tr>\n<tr>\n<td width=\"284\">GL_MODELVIEW<\/td>\n<td width=\"284\">\u6a21\u578b\u8996\u5716\u77e9\u9663<\/td>\n<\/tr>\n<tr>\n<td width=\"284\">GL_PROJECTION<\/td>\n<td width=\"284\">\u6295\u5f71\u77e9\u9663<\/td>\n<\/tr>\n<tr>\n<td width=\"284\">GL_COLOR<\/td>\n<td width=\"284\">\u984f\u8272\u77e9\u9663<\/td>\n<\/tr>\n<tr>\n<td width=\"284\">GL_TEXTURE<\/td>\n<td width=\"284\">\u7d0b\u7406\u77e9\u9663<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u793a\u4f8b<\/p>\n<ol>\n<li>glMatrixMode(GL_MODELVIEW); \u8a2d\u5b9a\u7576\u524d\u77e9\u9663\u70ba\u6a21\u578b\u8996\u5716\u77e9\u9663<\/li>\n<li>glLoadIdentity();\u8f09\u5165\u55ae\u4f4d\u77e9\u9663,\u4e26\u4e14\u671d\u5411\u8ca0Z\u8ef8<\/li>\n<li>\u9032\u884c\u5176\u5b83\u8b8a\u63db<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"284\">\u77e9\u9663\u5806\u68e7<\/td>\n<td width=\"284\">\u7c21\u4ecb<\/td>\n<\/tr>\n<tr>\n<td width=\"284\">void glPushMatrix(void);<\/td>\n<td width=\"284\">\u8907\u88fd\u7576\u524d\u77e9\u9663(\u68e7\u9802)\u4e26\u58d3\u68e7.<\/td>\n<\/tr>\n<tr>\n<td width=\"284\">void glPopMatrix(void);<\/td>\n<td width=\"284\">\u7576\u524d\u77e9\u9663\u5806\u68e7\u51fa\u68e7\u4e26\u4e1f\u68c4.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5c07\u7576\u524d\u5750\u6a19\u7cfb\u7d71\u5207\u63db\u70ba\u65b0\u5750\u6a19\u7cfb\u7d71,\u6e32\u67d3\u5b8c\u6210\u5f8c\u6062\u5fa9\u539f\u59cb\u5750\u6a19\u7cfb\u7d71.\u793a\u4f8b:<\/p>\n<ol>\n<li>glMatrixMode(GL_MODELVIEW);\u8a2d\u5b9a\u6a21\u578b\u8996\u5716\u77e9\u9663<\/li>\n<li>glPushMatrix();\u8907\u88fd\u7576\u524d\u77e9\u9663\u4e26\u58d3\u68e7.<\/li>\n<li>glLoadIdentity();\u8f09\u5165\u55ae\u4f4d\u77e9\u9663<\/li>\n<li>glTranslatef(x,y,x);\u79fb\u52d5\u5750\u6a19\u7cfb<\/li>\n<li>glPopMatrix();\u51fa\u68e7,\u6062\u5fa9\u6e90\u59cb\u5750\u6a19\u7cfb\u7d71<\/li>\n<\/ol>\n<p>\u4e0d\u540c\u77e9\u9663\u5806\u68e7\u6709\u4e0d\u540c\u7684\u6df1\u5ea6,\u53ef\u901a\u904eglGetIntegerv()\u7372\u53d6<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"252\">\u53c3\u6578<\/td>\n<td width=\"161\">\u6df1\u5ea6<\/td>\n<td width=\"155\">\u7c21\u4ecb<\/td>\n<\/tr>\n<tr>\n<td width=\"252\">GL_MAX_MODELVIEW_STACK_DEPTH<\/td>\n<td width=\"161\">32<\/td>\n<td width=\"155\">\u6a21\u578b\u8996\u5716\u77e9\u9663\u5806\u68e7\u7684\u6df1\u5ea6<\/td>\n<\/tr>\n<tr>\n<td width=\"252\">GL_MAX_PROJECTION_STACK_DEPTH<\/td>\n<td width=\"161\">10<\/td>\n<td width=\"155\">\u6295\u5f71\u77e9\u9663\u5806\u68e7\u7684\u6df1\u5ea6<\/td>\n<\/tr>\n<tr>\n<td width=\"252\">GL_MAX_TEXTURE_STACK_DEPTH<\/td>\n<td width=\"161\">10<\/td>\n<td width=\"155\">\u7d0b\u7406\u77e9\u9663\u5806\u68e7\u7684\u6df1\u5ea6<\/td>\n<\/tr>\n<tr>\n<td width=\"252\">GL_MAX_ATTRIB_STACK_DEPTH<\/td>\n<td width=\"161\">16<\/td>\n<td width=\"155\">\u5c6c\u6027\u77e9\u9663\u5806\u68e7\u7684\u6df1\u5ea6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7372\u53d6\u6a21\u578b\u8996\u5716\u77e9\u9663\u6df1\u5ea6\u793a\u4f8b:<\/p>\n<ol>\n<li>GLint params[1];<\/li>\n<li>glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH,params);<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>OpenGL\u7684\u8b8a\u63db\u904b\u7b97\u5747\u4f7f\u75284&#215;4\u77e9\u9663\u9032\u884c.OpenGL\u4f7f\u7528\u5806\u68e7\u4fdd\u5b58\u77e9\u9663.\u5404\u7a2e\u8b8a\u63db\u904b\u7b97\u5747\u91dd\u5c0d\u68e7\u9802\u9032\u884c &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.bookcard.net\/wordpress\/opengl_matrix\/\" class=\"more-link\">\u7e7c\u7e8c\u95b1\u8b80 <span class=\"screen-reader-text\">OpenGL\u4e4b\u77e9\u9663<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62],"tags":[50],"class_list":["post-3580","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\/3580","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=3580"}],"version-history":[{"count":4,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/3580\/revisions"}],"predecessor-version":[{"id":3586,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/3580\/revisions\/3586"}],"wp:attachment":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/media?parent=3580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/categories?post=3580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/tags?post=3580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}