{"id":10970,"date":"2021-10-24T19:51:08","date_gmt":"2021-10-24T11:51:08","guid":{"rendered":"https:\/\/www.bookcard.net\/wordpress\/?p=10970"},"modified":"2021-10-24T19:51:08","modified_gmt":"2021-10-24T11:51:08","slug":"android_studio_ndk_opengl_es_ortho_projection","status":"publish","type":"post","link":"https:\/\/www.bookcard.net\/wordpress\/android_studio_ndk_opengl_es_ortho_projection\/","title":{"rendered":"Android Studio NDK-OpenGL ES \u300e\u6b63\u4ea4\u6295\u5f71\u300f"},"content":{"rendered":"<figure id=\"attachment_10971\" aria-describedby=\"caption-attachment-10971\" style=\"width: 1280px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/10\/Android_Studio_NDK_OpenGL_ES_Ortho_Projection.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-10971\" src=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/10\/Android_Studio_NDK_OpenGL_ES_Ortho_Projection.jpg\" alt=\"Android Studio NDK-OpenGL ES \u300e\u6b63\u4ea4\u6295\u5f71\u300f\" width=\"1280\" height=\"800\" srcset=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/10\/Android_Studio_NDK_OpenGL_ES_Ortho_Projection.jpg 1280w, https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/10\/Android_Studio_NDK_OpenGL_ES_Ortho_Projection-300x188.jpg 300w, https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/10\/Android_Studio_NDK_OpenGL_ES_Ortho_Projection-768x480.jpg 768w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/a><figcaption id=\"caption-attachment-10971\" class=\"wp-caption-text\">Android Studio NDK-OpenGL ES \u300e\u6b63\u4ea4\u6295\u5f71\u300f<\/figcaption><\/figure>\n<p>3D\u6e38\u6232\u57fa\u4e8e\u300e\u900f\u8996\u6295\u5f71\u300f\u7522\u751f\u7acb\u9ad4\u6548\u679c, \u800c2D\u6e38\u6232\u6232\u7528\u300e\u6b63\u4ea4\u6295\u5f71\u300f\u7522\u751f\u5e73\u9762\u6548\u679c, \u751f\u6210\u7b49\u6bd4\u4f8b\u6e38\u6232.<\/p>\n<ol>\n<li>\u6307\u5b9a\u8996\u5340\u50cf\u7d20\u5c3a\u78bc, \u300ex\u300f \u300ey\u300f\u8996\u5340\u5de6\u4e0b\u89d2,\u300ewidth\u300f \u300eheight\u300f\u8996\u5340\u5bec\u9ad8<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">glViewport(0,0,width, height);<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol start=\"2\">\n<li>\u8a2d\u5b9a\u300e\u77e9\u9663\u5806\u6808\u300f\u70ba\u300e\u6295\u5f71\u77e9\u9663\u5806\u6808\u300f<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">glMatrixMode(GL_PROJECTION);<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol start=\"3\">\n<li>\u8f09\u5165\u55ae\u4f4d\u77e9\u9663, \u6e05\u9664\u300e\u5806\u6808\u300f\u6b8b\u7559\u300e\u77e9\u9663\u300f,\u4ee5\u6b64\u5514\u53d7\u5148\u524d\u8b8a\u6362\u904b\u7b97\u5f71\u54cd.<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">glLoadIdentity();<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol start=\"4\">\n<li>\u300e\u6b63\u4ea4\u6295\u5f71\u300f\u904b\u7b97, Y\u8ef8\u8996\u89d2\u300efovy\u300f,Z\u8ef8\u8996\u89d2\u300easpect\u300f, \u300ezNear\u300f\u8fd1\u88c1\u526a\u9762\u8ddd\u79bb\u7ea6\u6478\u7bb1\u6a5f\u65b9\u5411Y\u8ef8\u52a0 \u300ezFar\u300f\u8fdc\u88c1\u526a\u9762\u8ddd\u79bb\u8a2d\u8f03\u5927\u6570\u503c.<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">gluOrtho( fovy, aspect, zNear, zFar );<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol start=\"5\">\n<li>\u8a2d\u5b9a\u300e\u77e9\u9663\u5806\u6808\u300f\u70ba\u300e\u6a21\u578b\u8996\u5716\u77e9\u9663\u5806\u6808\u300f<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">glMatrixMode(GL_MODELVIEW);<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ol start=\"6\">\n<li>\u8f09\u5165\u55ae\u4f4d\u77e9\u9663<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">glLoadIdentity();<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>\u57fa\u65bc\u8996\u89d2\u300e\u6b63\u4ea4\u6295\u5f71\u300f<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">void gluOrtho(double\u00a0 fovy,double aspect,double zNear,double zFar){<\/p>\n<p>double\u00a0 xmin, xmax, ymin, ymax;<\/p>\n<p>ymax = zNear * tan(fovy * 3.141592654f \/ 360.0f);<\/p>\n<p>ymin = -ymax;<\/p>\n<p>xmin = ymin * aspect;<\/p>\n<p>xmax = ymax * aspect;<\/p>\n<p>glOrthof(xmin, xmax, ymin, ymax, zNear, zFar);<\/p>\n<p>}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>3D\u6e38\u6232\u57fa\u4e8e\u300e\u900f\u8996\u6295\u5f71\u300f\u7522\u751f\u7acb\u9ad4\u6548\u679c, \u800c2D\u6e38\u6232\u6232\u7528\u300e\u6b63\u4ea4\u6295\u5f71\u300f\u7522\u751f\u5e73\u9762\u6548\u679c, \u751f\u6210\u7b49\u6bd4\u4f8b\u6e38\u6232. \u6307\u5b9a\u8996\u5340\u50cf &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.bookcard.net\/wordpress\/android_studio_ndk_opengl_es_ortho_projection\/\" class=\"more-link\">\u7e7c\u7e8c\u95b1\u8b80 <span class=\"screen-reader-text\">Android Studio NDK-OpenGL ES \u300e\u6b63\u4ea4\u6295\u5f71\u300f<\/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":[4,62],"tags":[2,50],"class_list":["post-10970","post","type-post","status-publish","format-standard","hentry","category-android","category-opengl","tag-android","tag-opengl","entry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/10970","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=10970"}],"version-history":[{"count":1,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/10970\/revisions"}],"predecessor-version":[{"id":10972,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/10970\/revisions\/10972"}],"wp:attachment":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/media?parent=10970"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/categories?post=10970"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/tags?post=10970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}