//function to do multiplication
#include <gl/gl.h>
void MultiplyVMatrix(GLfloat* Vertex, GLfloat* Matrix, GLfloat* ResultMatrix)
{
for(int i=0;i<16;i++)
for(int j=0;j<4;j++)
ResultMatrix[j]+=Matrix[i]*Vertex[j];
}
**************************************************************
//modelview matrix and multiply co-ordinate of cube
GLfloat matrix[16];
GLfloat vertex[4]={1,2,-5,0}; //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);
translation.gif
Title | # Comments | Views | Activity |
---|---|---|---|
Will Java Webstart launch my game? | 6 | 127 | |
any RTS game state byte array size advice? | 6 | 219 | |
Java Chess - Any practical complete GIF zips for a chess app? | 4 | 73 | |
GPU processing of c++ library | 7 | 94 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
11 Experts available now in Live!