• Advertisement
Sign in to follow this  

how to matrxi multiplication in C++

This topic is 4870 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey i have 2 vectors and i was wondering how do i perform matrix muliplication on them thanks

Share this post


Link to post
Share on other sites
Advertisement
Just multiply it with the matrix as if it was a point but don't use the transformation column/row.

See GameDev's vectors and matrices article.

Share this post


Link to post
Share on other sites
they dont help, i know how to multi a matrix i just want to know if u can do it in C++ without having to right the method myself

Share this post


Link to post
Share on other sites
There's are no methods in c(++) that handle 3d math specific operations, but writing your own wouldn't be so hard i'd say:

void multVector(Vertex *v, float *mat){
v->x=v->x*mat[0]+v->x*mat[1]+v->x*mat[2];
v->y=v->y*mat[4]+v->y*mat[5]+v->y*mat[6];
v->z=v->z*mat[8]+v->z*mat[9]+v->z*mat[10];
}

If that's what you mean.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement