如何将"特征矩阵"发送给GLSL?例如:
// Set up the model and projection matrix Eigen::Matrixprojection_matrix; projection_matrix = frustum(-1.0f, 1.0f, -aspect, aspect, 1.0f, 500.0f); glUniformMatrix4fv(render_projection_matrix_loc, 1, GL_FALSE, &projection_matrix.data()[0]);
我way(matrix.date()[0])
为uBLAS 看了这个,但是Eigen不是uBLAS.我怎么能这样做?
只需调用.data()函数:
glUniformMatrix4fv(render_projection_matrix_loc, 1, GL_FALSE, projection_matrix.data());
您可能也会对<unsupported/Eigen/OpenGLSupport>
允许您编写的模块感兴趣:
glUniform(render_projection_matrix_loc, projection_matrix);
同时处理尺寸,标量类型,存储布局等.例如,它也适用于表达式:
glUniform(render_projection_matrix_loc, 2*projection_matrix.tranpose());