News Alert: Experts Exchange Confirmed as Safe in Cloudbleed Leak Read More
//function to do multiplication
#include <gl/gl.h>
void MultiplyVMatrix(GLfloat* Vertex, GLfloat* Matrix, GLfloat* ResultMatrix)
{
for(int i=0;i<16;i++)
ResultMatrix[i/4]+=Matrix[i]*Vertex[i%4];
}
**************************************************************
//modelview matrix and multiply co-ordinate of cube
GLfloat matrix[16];
GLfloat vertex[4]={1,2,-5,1}; //any co-ordinate for testing
GLfloat resultmatrix[4]={0,0,0,0};
glGetFloatv(GL_MODELVIEW_MATRIX, matrix); //grab the modelview matrix
MultiplyVMatrix(vertex,matrix,resultmatrix);
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
Fix45 challenge | 15 | 123 | |
Math Question: What is the max distance of x? | 5 | 76 | |
How many living descendants from a 23 years old in 1838? | 7 | 50 | |
using a 220V in USA vs 110 in Asia- which is more reliable. | 14 | 45 |
Join the community of 500,000 technology professionals and ask your questions.