本文整理汇总了C++中Mat4::inversed3方法的典型用法代码示例。如果您正苦于以下问题:C++ Mat4::inversed3方法的具体用法?C++ Mat4::inversed3怎么用?C++ Mat4::inversed3使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mat4
的用法示例。
在下文中一共展示了Mat4::inversed3方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
Mat4 E = Mat4::createIdent();
cout << "E\n" << E << endl;
Mat4 M = Mat4(mtr);
cout << "M\n" << M << endl << (M + 2) << endl << (M * 2) << endl << (M - 2) << endl << (M + E) << endl << (M * (E*2)) << endl;
Mat4 Minv = M.inversed3();
Vec4 v = Vec4(1, 2, 3);
Vec4 u = Vec4(5, 6, 7);
Vec4 v1 = Vec4(1, 3, 6), v2 = Vec4(22, 5, 1), v3 = Vec4(64, 45, 0, 9), v4 = Vec4(1, 32, 2, 1);
u.transpose();
cout << u << endl << v << endl;
Mat4 m = u*v;
cout << m << endl;
return 0;
glutInit(&argc, argv);
glutInitWindowSize(WT, HT);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutInitContextVersion(3, 3);
glutInitContextProfile(GLUT_CORE_PROFILE);
glutCreateWindow(CAPTION);
glutDisplayFunc(Render);
glewExperimental = GL_TRUE;
GLenum res = glewInit();
if (res != GLEW_OK)
return 1;
triangleShaderProgram = CreateProgram(
triangleVertexShaderName, GL_VERTEX_SHADER,
triangleFragmentShaderName, GL_FRAGMENT_SHADER);
squareShaderProgram = CreateProgram(
triangleVertexShaderName, GL_VERTEX_SHADER,
squareFragmentShaderName, GL_FRAGMENT_SHADER);
vertexArrays = new GLuint[FTCNT];
glGenVertexArrays(FTCNT, vertexArrays);
buffer = new GLuint[FTCNT];
glGenBuffers(FTCNT, buffer);
attribArray = glGetAttribLocation(triangleShaderProgram, "vertexPosition");
glEnableVertexAttribArray(attribArray);
glClearColor(0.2f, 0.3f, 0.4f, 0.0f);
glutMainLoop();
return 0;
}