1

If I have an object and I know its (x, y, z, yaw, pitch, roll). How can I move it distance D in the same direction its facing? (it has to move the same direction it is facing) then get the new point.

Any help will be appreciated

  • How can a point b facing something? – TaW Sep 25 '20 at 11:32
  • 1
    Sorry my bad, I meant and object that I know its center point, edited the post to make it clear – user8072779 Sep 25 '20 at 11:54
  • First determine what the forward vector would be if there was no rotation. Then rotate that vector by the yaw and pitch (roll doesn't effect where you're facing if it's last). That's your new forward vector; multiply it by D. – Jeff Sep 25 '20 at 14:38
  • @Jeff when you say multiply it by D do you mean (new yaw * D, new pitch * D)? if so, what will the new position will be (I mean the new x, y, z)? – user8072779 Sep 25 '20 at 14:48
  • This answer solved my problem https://stackoverflow.com/a/4598894/8072779 – user8072779 Oct 06 '20 at 21:29

0 Answers0