zoukankan      html  css  js  c++  java
  • 广州麒麟网络工作室 qlgame eninge(anroid) opengles c++ matrix

                在opengles中,采用的是可编程渲染管线,矩阵需要自己实现!

                先说一下矩阵的理论:           

                参考一下资料:http://blog.sina.com.cn/s/blog_6084f588010192ug.html

                                         http://www.opengl-tutorial.org/zh-hans/beginners-tutorials-zh/%EF%BB%BF%E7%AC%AC%E4%B8%89%E8%AF%BE%EF%BC%9A%E7%9F%A9%E9%98%B5/

                                        http://blog.db-in.com/cameras-on-opengl-es-2-x/(推荐)

                矩阵为16个float类型的数组,其中哪个数影响哪些信息,我用个图说明:

                image

             1.单位矩阵  任意矩阵乘以单位矩阵,都等于本矩阵,起到初始化的作用

               1    0     0    0

               0     1    0    1

               0     0    1    0

               0     0     0    1

             2.平移矩阵

                0     0    0      0

                0     0    0      0

                0     0    0      0

               tx     ty    tz     0

           3.绕X轴旋转

               1      0       0         0

               0      cos  sin      0

               0    -sin    cos     0

               0      0      0         1      

           4.绕Y轴旋转

              cos    0      -sin     0

              0        1       0       0

              sin      0      cos    0

              0        0       0        1

           5.绕Z轴旋转

              cos    -sin    0    0

              sin     cos    0    0

              0         0      1     0

              0         0      0      1

            6.sx  0   0   0

               0   sy  0   0

               0    0   sz  0

               0    0   0   1

              对矩阵的实现代码在matrix.cpp中有,一目了然,大家有问题可以与我讨论!

  • 相关阅读:
    Serverless
    使用excelJS实现excel文件转json文件
    使用excelJS实现json文件转excel文件
    git rebase 和 git merge的异同
    JS 箭头函数与普通函数的区别
    JS 节流函数(throttle)与防抖函数(debounce)
    http协议解析
    前端必会的js知识总结整理
    前端必会css整理
    推荐几个有趣的在线调试工具
  • 原文地址:https://www.cnblogs.com/alongu3d/p/4514582.html
Copyright © 2011-2022 走看看