{"id":477,"date":"2021-07-03T10:35:10","date_gmt":"2021-07-03T02:35:10","guid":{"rendered":"https:\/\/swordofmorning.com\/?p=477"},"modified":"2025-10-09T13:56:04","modified_gmt":"2025-10-09T05:56:04","slug":"computer-graphics-install-third-party-math-libraries-for-opengl","status":"publish","type":"post","link":"https:\/\/swordofmorning.com\/index.php\/2021\/07\/03\/computer-graphics-install-third-party-math-libraries-for-opengl\/","title":{"rendered":"\u8ba1\u7b97\u673a\u56fe\u5f62\u5b66 \u4e3aOpenGL\u5b89\u88c5\u7b2c\u4e09\u65b9\u6570\u5b66\u5e93"},"content":{"rendered":"<h2>\u4ecb\u7ecd<\/h2>\n<p>&emsp;&emsp;\u8003\u8651\u5230C++\u6807\u51c6\u5e93\u548cOpenGL\u4e0d\u63d0\u4f9b\u590d\u6742\u76843D\u6570\u5b66\u8fd0\u7b97\uff0c\u4e8e\u662f\u8003\u8651\u5b89\u88c5\u7b2c\u4e09\u65b93D\u6570\u5b66\u5e93\u3002\u8fd9\u91cc\u4f7f\u7528\u4e86GitHub\u4e0a\u7684glm\u3002<br \/>\n&emsp;&emsp;\u8be5\u9879\u76ee\u5305\u542b\u4e86\u77e9\u9635\u57fa\u672c\u8fd0\u7b97\uff0c\u5e76\u4e14\u517c\u5bb9OpenGL\uff0c\u4e14\u63d0\u4f9b\u81ea\u5b9a\u4e49\u7c7b\u3002<\/p>\n<h2>\u5b89\u88c5<\/h2>\n<p>&emsp;&emsp;\u4f7f\u7528VS\u5b89\u88c5\u6bd4\u8f83\u65b9\u4fbf\uff1a<\/p>\n<ol>\n<li>\u5728\u5de5\u5177\u680f\u9009\u62e9\u201c\u9879\u76ee\u201d\u3002<\/li>\n<li>\u9009\u62e9\u201cNuGet\u7a0b\u5e8f\u201d\u3002<\/li>\n<li>\u641c\u7d22glm\uff0c\u5e76\u5b89\u88c5\u3002<\/li>\n<\/ol>\n<h2>\u7a0b\u5e8f\u6f14\u793a<\/h2>\n<pre><code>#include &lt;iostream&gt;\n#include &lt;glm\/glm.hpp&gt;\n\nint main()\n{\n    glm::vec&lt;3, double&gt; ve1 = { 1, 0, 0 };\n    glm::vec&lt;3, double&gt; ve2 = { 0, 1, 0 };\n    glm::vec&lt;3, double&gt; ve3 = { 0, 0, 0 };\n    ve3 = glm::cross(ve1, ve2);\n\n    std::cout &lt;&lt; ve3[0] &lt;&lt; std::endl;\n    std::cout &lt;&lt; ve3[1] &lt;&lt; std::endl;\n    std::cout &lt;&lt; ve3[2] &lt;&lt; std::endl;\n\n    return 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4ecb\u7ecd &emsp;&emsp;\u8003\u8651\u5230C++\u6807\u51c6\u5e93\u548cOpenGL\u4e0d\u63d0\u4f9b\u590d\u6742\u76843D\u6570\u5b66\u8fd0\u7b97\uff0c\u4e8e\u662f\u8003\u8651\u5b89\u88c5\u7b2c\u4e09\u65b93D\u6570\u5b66\u5e93\u3002\u8fd9\u91cc\u4f7f\u7528\u4e86G &#8230;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62],"tags":[237],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/posts\/477"}],"collection":[{"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/comments?post=477"}],"version-history":[{"count":1,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/posts\/477\/revisions"}],"predecessor-version":[{"id":478,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/posts\/477\/revisions\/478"}],"wp:attachment":[{"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/media?parent=477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/categories?post=477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/tags?post=477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}