Translate Point B in relation to point A?

Started by
3 comments, last by Paul Griffiths 7 years, 2 months ago
I have 3 matrix4.

glm::mat4 A;
glm::mat4 B;
glm::mat4 C;

I wish to translate and rotate A to C and B gets translated and rotated with it as in this diagram. How to get B? This is 3D, x, y & z. Any ideas?

translation.jpg

Advertisement
C * A^-1 * B? Something like that, anyway.

C * A^-1 * B? Something like that, anyway.

What does the ^ mean?

Thanks.

C * A^-1 * B? Something like that, anyway.

What does the ^ mean?
Thanks.


^ means "superscript", so A^-1 means "the inverse of A"

C * A^-1 * B? Something like that, anyway.

What does the ^ mean?
Thanks.


^ means "superscript", so A^-1 means "the inverse of A"

Thanks, I tried it:

B = C * glm::inverse(A) * B;

Appreciated!

This topic is closed to new replies.

Advertisement