*Correction*
GLfloat vertex[4]={1,2,-5,1};
//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);
Title | # Comments | Views | Activity |
---|---|---|---|
Loan to Value to interest rate relationship formula | 1 | 149 | |
Group Data Frequency Distribution | 9 | 39 | |
Error in calculation | 3 | 36 | |
Graph | 5 | 61 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
14 Experts available now in Live!