3
\$\begingroup\$

Lets say I know what is directly above a turret. I also know where the turrets gun is currently pointing. I would like to know where will the turret's gun will point if I rotate it.

I suppose I could multiply A (.) B, project A on the plane B is a normal of and then do the rotation in 2d and add back A (.) B but I am sure the math should be simpler than that?

enter image description here

\$\endgroup\$
1
\$\begingroup\$

you want to reflect A across B, this has a simple formula: (if B has length 1)

-A+2*(A.B)

or minus A plus 2 times the dot product between A and B

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.