{"id":10937,"date":"2021-10-07T21:57:25","date_gmt":"2021-10-07T13:57:25","guid":{"rendered":"https:\/\/www.bookcard.net\/wordpress\/?p=10937"},"modified":"2021-10-07T21:57:25","modified_gmt":"2021-10-07T13:57:25","slug":"android_studio_ndk_opengl_es_gluperspective","status":"publish","type":"post","link":"https:\/\/www.bookcard.net\/wordpress\/android_studio_ndk_opengl_es_gluperspective\/","title":{"rendered":"Android Studio NDK-OpenGL ES-3D\u76f8\u6a5fgluPerspective()"},"content":{"rendered":"<figure id=\"attachment_10938\" aria-describedby=\"caption-attachment-10938\" style=\"width: 1280px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/10\/Android_Studio_NDK_OpenGL_ES_gluPerspective.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-10938\" src=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/10\/Android_Studio_NDK_OpenGL_ES_gluPerspective.jpg\" alt=\"Android Studio NDK-OpenGL ES-3D\u76f8\u6a5fgluPerspective()\" width=\"1280\" height=\"800\" srcset=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/10\/Android_Studio_NDK_OpenGL_ES_gluPerspective.jpg 1280w, https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/10\/Android_Studio_NDK_OpenGL_ES_gluPerspective-300x188.jpg 300w, https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2021\/10\/Android_Studio_NDK_OpenGL_ES_gluPerspective-768x480.jpg 768w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/a><figcaption id=\"caption-attachment-10938\" class=\"wp-caption-text\">Android Studio NDK-OpenGL ES-3D\u76f8\u6a5fgluPerspective()<\/figcaption><\/figure>\n<p>\u5c07\u300eOpenGL\u300f\u79fb\u7a19\u904e\u300eAndord\u300f. \u4f46OpenGL ES\u504f\u504f\u5187gluPerspective()\u8996\u9310\u6295\u5f71.\u4f46\u6709glFrustumf()\u8a2d\u5b9a\u8996\u53e3.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"575\">\u901a\u904eglFrustumf()\u8a2d\u7f6e\u8996\u53e3, \u5f97\u5230 gluPerspective()\u8996\u9310\u6295\u5f71.<\/td>\n<\/tr>\n<tr>\n<td width=\"575\">void gluPerspective(double\u00a0 fovy,double aspect,double zNear,double zFar){<\/p>\n<p>double\u00a0 ymax = zNear * tan(fovy * 3.141592654f \/ 360.0f);<\/p>\n<p>double\u00a0 ymin = -ymax;<\/p>\n<p>double\u00a0\u00a0\u00a0 xmin = ymin * aspect;<\/p>\n<p>double\u00a0\u00a0\u00a0 xmax = ymax * aspect;<\/p>\n<p>glFrustumf(xmin, xmax, ymin, ymax, zNear, zFar);<\/p>\n<p>}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>3D\u76f8\u6a5f\u6295\u5f71\u4ee3\u78bc<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"407\">glViewport(0,0,viewport_width,viewport_height);<\/td>\n<td width=\"168\">\u91cd\u7f6e\u8996\u5340\u5c3a\u5bf8<\/td>\n<\/tr>\n<tr>\n<td width=\"407\">glMatrixMode(GL_PROJECTION);<\/td>\n<td width=\"168\">\u8a2d\u5b9a\u6295\u5f71\u77e9\u9663<\/td>\n<\/tr>\n<tr>\n<td width=\"407\">glLoadIdentity();<\/td>\n<td width=\"168\">\u8f09\u5165\u55ae\u4f4d\u77e9\u9663<\/td>\n<\/tr>\n<tr>\n<td width=\"407\">gluPerspective(fov,aspect_ratio,near_clip_z,far_clip_z);<\/td>\n<td width=\"168\">\u8a2d\u7f6e\u8996\u9310\u9ad4\u6295\u5f71<\/td>\n<\/tr>\n<tr>\n<td width=\"407\">glMatrixMode(GL_MODELVIEW);<\/td>\n<td width=\"168\">\u8a2d\u5b9a\u6a21\u578b\u8996\u5716\u77e9\u9663<\/td>\n<\/tr>\n<tr>\n<td width=\"407\">glLoadIdentity();<\/td>\n<td width=\"168\">\u8f09\u5165\u55ae\u4f4d\u77e9\u9663<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5c07\u300eOpenGL\u300f\u79fb\u7a19\u904e\u300eAndord\u300f. \u4f46OpenGL ES\u504f\u504f\u5187gluPerspective()\u8996\u9310\u6295\u5f71 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.bookcard.net\/wordpress\/android_studio_ndk_opengl_es_gluperspective\/\" class=\"more-link\">\u7e7c\u7e8c\u95b1\u8b80 <span class=\"screen-reader-text\">Android Studio NDK-OpenGL ES-3D\u76f8\u6a5fgluPerspective()<\/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-10937","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\/10937","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=10937"}],"version-history":[{"count":1,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/10937\/revisions"}],"predecessor-version":[{"id":10939,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/10937\/revisions\/10939"}],"wp:attachment":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/media?parent=10937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/categories?post=10937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/tags?post=10937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}