Jump to content
  • Advertisement
Sign in to follow this  

Matrix -> Vector3?

This topic is 2566 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

Hi guys!

I have my light position stored in a matrix, after all calculations that were required.

Now i need to pass position as a vector3 to other method,

is it possible to obtain the 'actual' position from a matrix?

Let's say to obtain final position of my light i had to:



// actor_ModelMatrix - is the actual model matrix for the player ( his position and current rotation )

// actor_BoneMatrix - is the selected bone matrix (position+rotation) - let's say it is his hand bone.

What i need to do is get x,y,z of that rotated/translated position into a vector3:

vector3 position;

What should i do to get those?

Many thanks guys!!

Share this post

Link to post
Share on other sites
is this the local to bone matrix ? or bone to local matrix ? i'm not sure of what you want to do, but at a glance you can invert your matrixLightPosition and get the position from the 4th row or column depending whether you are in column major or row major for your matrices.

Share this post

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!