math - Getting a vector coordinate post matrix multiplication -


i have series of transformations take object , put somewhere else. manually multiplying these transformations programmable pipeline in gl/es. i'm rotating around distant arbitrary points , translating, , while have no trouble getting object position want it, i'd know how can extract final 3d vector coordinate of position after these transformations.?

one option, suggested this question, multiply starting position final matrix , keep result vector final coordinate. if so, vector use represent object's origin before these transformations? because multiplying matrix origin (0,0,0) results in vector of zeroes.

the solution surprisingly simple.

if have matrix m final transformation created matrix multiplications, can find center of object transformed m simply:

m * vector(0,0,0,1) // creates 4d vector, first three, x,y,z coordinates 

this done manually in code.

the key piece question missing exact vector use multiplication.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -